AesirMonoBehaviour¶
- 种类:
abstract class - 命名空间:
Runestone.AesirArchitecture - 程序集:
Runestone.AesirArchitecture
继承链: System.Object → UnityEngine.Object → UnityEngine.Component → UnityEngine.Behaviour → UnityEngine.MonoBehaviour → Sirenix.OdinInspector.SerializedMonoBehaviour → AesirMonoBehaviour
实现接口: Sirenix.Serialization.ISupportsPrefabSerialization,UnityEngine.ISerializationCallbackReceiver
声明¶
public abstract class AesirMonoBehaviour : Sirenix.OdinInspector.SerializedMonoBehaviour,
Sirenix.Serialization.ISupportsPrefabSerialization,
UnityEngine.ISerializationCallbackReceiver
RAA 架构标准 MonoBehaviour 基类,根据运行环境自动选择序列化方式。
备注
通过条件编译在编译期决定基类,避免运行时反射开销: 编辑器 + 定义了 ODIN_INSPECTOR:继承 SerializedMonoBehaviour,获得 Odin 序列化能力,编辑器内可使用 Odin Inspector。 运行时 + 定义了 ODIN_INSPECTOR 且未定义 ODIN_INSPECTOR_EDITOR_ONLY:继承 SerializedMonoBehaviour,运行时也使用 Odin 序列化。 其他情况:继承 MonoBehaviour,使用 Unity 默认序列化。 ODIN_INSPECTOR_EDITOR_ONLY 宏用于在运行时剔除 Odin 序列化(减小包体), 同时保留编辑器内的 Odin Inspector 体验。 警告:定义该宏后,编辑器分支经 Odin 序列化后端持久化、构建分支回退为裸 Unity 序列化后端—— 编辑器内经 Odin 录入而 Unity 无法原生序列化的数据(字典、私有字段等)在玩家构建中会静默丢失。 使用该宏前请确认序列化字段均为 Unity 原生可序列化形态。
属性¶
| 名称 | 描述 | 声明类型 |
|---|---|---|
destroyCancellationToken |
— | MonoBehaviour |
gameObject |
— | Component |
hideFlags |
— | Object |
transform |
— | Component |
enabled |
— | Behaviour |
isActiveAndEnabled |
— | Behaviour |
runInEditMode |
— | MonoBehaviour |
useGUILayout |
— | MonoBehaviour |
name |
— | Object |
tag |
— | Component |
animation |
— | Component |
audio |
— | Component |
camera |
— | Component |
collider |
— | Component |
collider2D |
— | Component |
constantForce |
— | Component |
hingeJoint |
— | Component |
light |
— | Component |
networkView |
— | Component |
particleSystem |
— | Component |
renderer |
— | Component |
rigidbody |
— | Component |
rigidbody2D |
— | Component |
方法¶
| 名称 | 描述 | 声明类型 |
|---|---|---|
GetComponent(Type) |
— | Component |
GetComponent(string) |
— | Component |
GetComponentInChildren(Type) |
— | Component |
GetComponentInChildren(Type, bool) |
— | Component |
GetComponentInParent(Type) |
— | Component |
GetComponentInParent(Type, bool) |
— | Component |
GetComponents(Type) |
— | Component |
GetComponentsInChildren(Type) |
— | Component |
GetComponentsInChildren(Type, bool) |
— | Component |
GetComponentsInParent(Type) |
— | Component |
GetComponentsInParent(Type, bool) |
— | Component |
StartCoroutine(IEnumerator) |
— | MonoBehaviour |
StartCoroutine(string) |
— | MonoBehaviour |
StartCoroutine(string, object) |
— | MonoBehaviour |
GetComponent() |
— | Component |
GetComponentInChildren() |
— | Component |
GetComponentInChildren(bool) |
— | Component |
GetComponentInParent() |
— | Component |
GetComponentInParent(bool) |
— | Component |
GetComponents() |
— | Component |
GetComponentsInChildren() |
— | Component |
GetComponentsInChildren(bool) |
— | Component |
GetComponentsInParent() |
— | Component |
GetComponentsInParent(bool) |
— | Component |
GetType() |
— | object |
CompareTag(string) |
— | Component |
IsInvoking() |
— | MonoBehaviour |
IsInvoking(string) |
— | MonoBehaviour |
TryGetComponent(Type, ref Component) |
— | Component |
TryGetComponent(ref T) |
— | Component |
GetComponentIndex() |
— | Component |
GetInstanceID() |
— | Object |
Equals(object) |
— | Object |
GetHashCode() |
— | Object |
ToString() |
— | Object |
BroadcastMessage(string) |
— | Component |
BroadcastMessage(string, SendMessageOptions) |
— | Component |
BroadcastMessage(string, object) |
— | Component |
BroadcastMessage(string, object, SendMessageOptions) |
— | Component |
CancelInvoke() |
— | MonoBehaviour |
CancelInvoke(string) |
— | MonoBehaviour |
GetComponents(Type, List<Component>) |
— | Component |
GetComponents(List<T>) |
— | Component |
GetComponentsInChildren(List<T>) |
— | Component |
GetComponentsInChildren(bool, List<T>) |
— | Component |
GetComponentsInParent(bool, List<T>) |
— | Component |
Invoke(string, float) |
— | MonoBehaviour |
InvokeRepeating(string, float, float) |
— | MonoBehaviour |
SendMessage(string) |
— | Component |
SendMessage(string, SendMessageOptions) |
— | Component |
SendMessage(string, object) |
— | Component |
SendMessage(string, object, SendMessageOptions) |
— | Component |
SendMessageUpwards(string) |
— | Component |
SendMessageUpwards(string, SendMessageOptions) |
— | Component |
SendMessageUpwards(string, object) |
— | Component |
SendMessageUpwards(string, object, SendMessageOptions) |
— | Component |
StopAllCoroutines() |
— | MonoBehaviour |
StopCoroutine(Coroutine) |
— | MonoBehaviour |
StopCoroutine(IEnumerator) |
— | MonoBehaviour |
StopCoroutine(string) |
— | MonoBehaviour |
MemberwiseClone() |
— | object |
Finalize() |
— | object |
OnAfterDeserialize() |
— | SerializedMonoBehaviour |
OnBeforeSerialize() |
— | SerializedMonoBehaviour |
StartCoroutine_Auto(IEnumerator) |
— | MonoBehaviour |
Additional Notes¶
首个
## Additional Notes是增量生成文档标识符,请勿修改标题级别和内容!本文档由Script Doc Generator辅助生成。