private void OnValidate() { if (UnityEditor.PrefabUtility.IsPartOfAnyPrefab(this)) { string path = UnityEditor.AssetDatabase.GetAssetPath(gameObject); if (!string.IsNullOrEmpty(path)) { Debug.LogError($"不能在预制件使用RuntimeBehaviourExecutor:{path}"); } enabled = false; return; } if (!behaviour) { behaviour = BehaviourTree.GetRuntimeTree(); } isRuntimeMode = true; }