Exemplo n.º 1
0
 private void SelectGameObject()
 {
     if (GUILayout.Button(BehaviorTreesEditor.activeGameObject != null ? BehaviorTreesEditor.activeGameObject.name : "[None Selected]", EditorStyles.toolbarDropDown, GUILayout.Width(100)))
     {
         GenericMenu  toolsMenu = new GenericMenu();
         List <Brain> brains    = BehaviorTreesEditorUtility.FindInScene <Brain>();
         foreach (Brain brain in brains)
         {
             GameObject gameObject = brain.gameObject;
             toolsMenu.AddItem(new GUIContent(gameObject.name), false, delegate()
             {
                 BehaviorTreesEditor.SelectGameObject(gameObject);
             });
         }
         toolsMenu.ShowAsContext();
     }
 }
Exemplo n.º 2
0
 private void OnSelectionChange()
 {
     // This code is borrowed from ICode(https://www.assetstore.unity3d.com/en/#!/content/13761)
     BehaviorTreesEditor.SelectGameObject(Selection.activeGameObject);
 }