Ejemplo n.º 1
0
 private void Init()
 {
     if (_statusBar == null)
     {
         _statusBar = new StatusBarDrawer();
     }
     if (_paramPanel == null)
     {
         _paramPanel = new ParamPanelDrawer();
     }
     _cursorChangeRect = new Rect(_currentViewWidth, 0f, 5f, position.height);
     if (Selection.activeObject is AiBehaviour && EditorUtility.IsPersistent(Selection.activeObject))
     {
         _target = (AiBehaviour)Selection.activeObject;
         _statusBar.Blackboard        = _target;
         _paramPanel.Blackboard       = _target;
         _treeDrawer                  = new TreeDrawer(_statusBar.CurrentTree);
         _statusBar.OnSelectedAiTree += _treeDrawer.RebuildTreeView;
     }
     else if (Selection.activeGameObject != null && Selection.activeGameObject.GetComponent <AiController>() != null && Selection.activeGameObject.GetComponent <AiController>().Behaviour != null)
     {
         _target = Selection.activeGameObject.GetComponent <AiController>().Behaviour;
         _statusBar.Blackboard        = _target;
         _paramPanel.Blackboard       = _target;
         _treeDrawer                  = new TreeDrawer(_statusBar.CurrentTree);
         _statusBar.OnSelectedAiTree += _treeDrawer.RebuildTreeView;
     }
     Repaint();
 }
Ejemplo n.º 2
0
 private void Init()
 {
     if (_statusBar == null) {
         _statusBar = new StatusBarDrawer();
     }
     if (_paramPanel == null) {
         _paramPanel = new ParamPanelDrawer();
     }
     _cursorChangeRect = new Rect(_currentViewWidth, 0f, 5f, position.height);
     if (Selection.activeObject is AiBehaviour && EditorUtility.IsPersistent(Selection.activeObject)) {
         _target = (AiBehaviour)Selection.activeObject;
         _statusBar.Blackboard = _target;
         _paramPanel.Blackboard = _target;
         _treeDrawer = new TreeDrawer(_statusBar.CurrentTree);
         _statusBar.OnSelectedAiTree += _treeDrawer.RebuildTreeView;
     } else if (Selection.activeGameObject != null && Selection.activeGameObject.GetComponent<AiController>() != null && Selection.activeGameObject.GetComponent<AiController>().Behaviour != null) {
         _target = Selection.activeGameObject.GetComponent<AiController>().Behaviour;
         _statusBar.Blackboard = _target;
         _paramPanel.Blackboard = _target;
         _treeDrawer = new TreeDrawer(_statusBar.CurrentTree);
         _statusBar.OnSelectedAiTree += _treeDrawer.RebuildTreeView;
     }
     Repaint();
 }