コード例 #1
0
        override public void OnInspectorGUI()
        {
            brain = target as Brain;

            Initialize();

            if (GUILayout.Button("Edit Brain"))
            {
                BrainWindow.ShowWindow(brain);
            }

            DrawParameters();

            if ((BrainWindow.window != null))
            {
                if (BrainWindow.window.selectedNode != null)
                {
                    DrawNodeInspector(BrainWindow.window.selectedNode);
                }

                if (BrainWindow.window.selectedConnection != null)
                {
                    DrawConnectionInspector(BrainWindow.window.selectedConnection);
                }
            }

            if (GUILayout.Button("Clear"))
            {
                brain.Clear();
                RefreshAsset();
            }
        }
コード例 #2
0
ファイル: BrainWindow.cs プロジェクト: hellotheredev/Brains
        public static void ShowWindow(Brain brain)
        {
            window = EditorWindow.GetWindow(typeof(BrainWindow)) as BrainWindow;
            window.title = "Brain";
            window.scrollPosition = Vector2.zero;
            window.brain = brain;

            window.CenterOnNodes();
        }
コード例 #3
0
ファイル: BrainWindow.cs プロジェクト: hellotheredev/Brains
        void OnGUI()
        {
            window = this;

            if(brain == null) brain = Selection.activeObject as Brain;
            if(brain == null)
            {
                GUILayout.Label("Select a brain.");
                return;
            }

            GUILayout.Label(scrollPosition.ToString());

            DrawBrain();

            WindowEvents();
        }