1.普通写法和泛型类写法
class MyClass
{
int[] arr = new int[100];
public int this[int i]
{
set { arr[i] = value; }
get { return arr[i]; }
}
}
class MyList<T>
{
T[] items;
public T this[int i]
{
get { return items[i]; }
set { this.items[i] = value; }
}
}
2.代码各种命名规则记录
Pascal Case :所有单词首字母大写,其他小写(P)
Camel Case :除第一个单词其他首字母大写(C)
NameSpace:(P)
Class:(P)
Interface:(P)
Attribute:(C)
Enumeration Type:(P)
Static File:(P)
Private:(C)
Public:(P)
Local Private:(_C)
Parameter:(C)
Method:(P)
Property:(P)
Event:(P)
3.添加绑定组件
[RequireComponent(typeof(type))]