protected到下一个权限关键字之间的成员称为保护成员 (protected member),保护成员可以在类体中使用,也可以 在派生类中使用,但不能在其他类外通过对象使用。
基于12个网页-相关网页
Do not provide public or protected member variables. Use properties instead.
不要使用公开的或保护的类成员变量,使用属性。
Private and protected member variables are shown only in Expert Mode. Properties are not serialized or shown in the inspector.
私有和保护变量只能在专家模式中显示。属性不被序列化或显示在检视面板。
Only member variables are serialized and are shown in the inspector. Private and protected member variables are shown only in Expert Mode. Properties are not serialized or shown in the inspector.
只有序列化的成员变量才能显示在检视面板,私有和保护变量只能在专家模式中显示。属性不被序列化或显示在检视面板。
应用推荐