/// <summary> /// Update the hideFlag of all states on the same GameObject as the supplied blackboard. /// <param name ="blackboard">The target blackboard.</param> /// </summary> static void OnBlackboardHideFlag (InternalBlackboard blackboard) { // It's a blackboard? if (blackboard != null) { // Get the prefab type var prefabType = UnityEditor.PrefabUtility.GetPrefabType(blackboard.gameObject); // Its an instance of a prefab? if (prefabType != UnityEditor.PrefabType.None) { // Get all states in the blackboard InternalStateBehaviour[] states = blackboard.GetComponents<InternalStateBehaviour>(); for (int i = 0; i < states.Length; i++) OnStateHideFlag(states[i]); } } }