Exemplo n.º 1
0
 public void AddChild(BehaviourBlackboard child)
 {
     if (!m_children.Contains(child))
     {
         m_children.Add(child);
         child.SetParent(this);
     }
 }
 public void RemoveBlackboard(BehaviourBlackboard blackboard)
 {
     _blackboards.Remove(blackboard);
     if (blackboard == CurrentBlackboard)
     {
         CurrentBlackboard = _blackboards.FirstOrDefault();
     }
 }
        public BehaviourBlackboard AddBlackboard()
        {
            var blackboard = new BehaviourBlackboard();

            _blackboards.Add(blackboard);
            if (CurrentBlackboard == null)
            {
                CurrentBlackboard = blackboard;
            }

            return(blackboard);
        }
        private void DrawBlackboardKeyValues(string label, BehaviourBlackboard blackboard)
        {
            if (blackboard == null)
            {
                return;
            }
            EditorGUILayout.BeginVertical();
            GUILayout.Label(label, EditorStyles.boldLabel);
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            List <string> keys = blackboard.GetDataKeys();

            foreach (string key in keys)
            {
                DrawKeyValue(key, blackboard.Get(key).ToString());
            }
            EditorGUILayout.EndVertical();
            EditorGUILayout.EndVertical();
        }
Exemplo n.º 5
0
 public void RemoveChild(BehaviourBlackboard child)
 {
     child.SetParent(null);
     m_children.Remove(child);
 }
Exemplo n.º 6
0
 public void SetParent(BehaviourBlackboard parent)
 {
     Parent = parent;
     Parent?.AddChild(this);
 }