コード例 #1
0
        // PRAGMA MARK - Internal
        private void OnSelectionChange()
        {
            var oldWindow = EditorWindow.focusedWindow;

            UnityEngine.Object activeObject = Selection.activeObject;

            if (activeObject is GraphComponent)
            {
                GraphAssetEditorWindow.ConfigureWindow((GraphComponent)activeObject);
            }
            else if (activeObject is GraphAsset)
            {
                GraphAssetEditorWindow.ConfigureWindow((GraphAsset)activeObject);
            }
            else if (Selection.activeGameObject != null)
            {
                GraphComponent graphComponent = Selection.activeGameObject.GetComponent <GraphComponent>();
                if (graphComponent != null && graphComponent.graphAsset != null)
                {
                    GraphAssetEditorWindow.ConfigureWindow(graphComponent);
                }
            }
            else
            {
                return;
            }

            if (oldWindow)
            {
                oldWindow.Focus();
            }
        }
コード例 #2
0
        // PRAGMA MARK - Static
        private static void ConfigureWindow(GraphComponent graphComponent)
        {
            if (graphComponent == null)
            {
                return;
            }

            GraphAssetEditorWindow.ConfigureWindow(graphComponent.graphAsset);
        }
コード例 #3
0
        private static void ConfigureWindow(GraphAsset graphAsset)
        {
            if (graphAsset == null)
            {
                return;
            }

            GraphAssetEditorWindow window = EditorWindow.GetWindow(typeof(GraphAssetEditorWindow)) as GraphAssetEditorWindow;

            window.ConfigureWithGraphAsset(graphAsset);
            window.Show();
        }
コード例 #4
0
        public static void ShowWindow()
        {
            GraphAssetEditorWindow window = EditorWindow.GetWindow(typeof(GraphAssetEditorWindow)) as GraphAssetEditorWindow;

            window.Show();
        }