Unity3D 对象池

第一种写法 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65

Game Programming Patterns

What is Software Architecture? It’s less about writing code than it is about organizing it. Good architecture makes a huge difference in productivity. But, like all things in life, it doesn’t come free. Good architecture takes real effort and discipline. Every time you make a change or implement a feature, you have to work hard to integrate it gracefully into the rest of the program. You have to think about which parts of the program should be decoupled and introduce abstractions at those points.

C# in Depth

The Changing Face of C# Development A Simple Data Type Read-only properties and Weakly typed collections (C# 1) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 using System.Collections; public class Product { string name; public string Name { get { return name; } } decimal price; public decimal Price { get { return price; } } public Product(string name, decimal price) { this.

Unity3D 小地图

制作小地图,先添加一个Camera专门用来显示地图,设为正交相机,然后有两种制作方法。 直接使用地图相机 调整小地图Camera的Viewpor

常见基础知识

为什么栈比堆快 分配和释放:堆在分配和释放时都要调用函数,分配时会到堆空间去寻找足够大小的空间,这些都会花费一定的时间,而栈却不需要这些,栈是

C#知识点

C# 继承结构 通过继承一个现有的类,新创建的类可以不需要写任何代码, 就可以按照继承来的父类中的合适的访问权限直接拥有所继承的类的功能, 同时还可以

常见算法汇总

一些常见算法的汇总 概率计算 1 2 3 4 static bool GetProbability(int percentage) { return Random.Range(0, 100) < percentage; } 判断两个时间段是否相交或重叠 1 bool overlap = a.start < b.end && b.start < a.end; 通过相交判断,可以求得相交最多的片