Пример #1
0
        public static void checkInit()
        {
            if (!initiated && !InitiationError)
            {
        #if UNITY_EDITOR
                Object script = UnityEditor.AssetDatabase.LoadAssetAtPath(editorPath + "Framework/NodeEditor.cs", typeof(Object));
                if (script == null)
                {
                    Debug.LogError("Node Editor: Not installed in default directory '" + editorPath + "'! Please modify the editorPath variable in the source!");
                    InitiationError = true;
                    return;
                }
        #endif

                ResourceManager.Init(editorPath + "Resources/");

                if (!NodeEditorGUI.Init())
                {
                    InitiationError = true;
                }

                ConnectionTypes.FetchTypes();

                NodeTypes.FetchNodes();

                NodeEditorCallbacks.SetupReceivers();
                NodeEditorCallbacks.IssueOnEditorStartUp();

                GUIScaleUtility.Init();

                initiated = true;
            }
        }
Пример #2
0
        public static void ReInit(bool GUIFunction)
        {
            CheckEditorPath();

            // Init Resource system. Can be called anywhere else, too, if it's needed before.
            ResourceManager.Init(editorPath + "Resources/");

            // Init NE GUI. I may throw an error if a texture was not found.
            if (!NodeEditorGUI.Init(GUIFunction))
            {
                InitiationError = true;
                return;
            }

            // Run fetching algorithms searching the script assemblies for Custom Nodes / Connection Types
            ConnectionTypes.FetchTypes();
            NodeTypes.FetchNodes();

            // Setup Callback system
            NodeEditorCallbacks.SetupReceivers();
            NodeEditorCallbacks.IssueOnEditorStartUp();

            // Init GUIScaleUtility. This fetches reflected calls and my throw a message notifying about incompability.
            GUIScaleUtility.Init();

        #if UNITY_EDITOR
            RepaintClients();
        #endif
            initiated = true;
        }
Пример #3
0
        /// <summary>
        /// Setup of the GUI. Only called when a GUI representation is actually used.
        /// </summary>
        private static void setupGUI()
        {
            initiatedGUI = false;

            // Init GUIScaleUtility. This fetches reflected calls and might throw a message notifying about incompability.
            GUIScaleUtility.CheckInit();

            if (!NodeEditorGUI.Init())
            {
                InitiationError = true;
                return;
            }

                #if UNITY_EDITOR
            RepaintClients();
                #endif

            initiatedGUI = true;
        }
 public static void ReInit(bool GUIFunction)
 {
     CheckEditorPath();
     ResourceManager.SetDefaultResourcePath(editorPath + "Resources/");
     if (!NodeEditorGUI.Init(GUIFunction))
     {
         InitiationError = true;
     }
     else
     {
         ConnectionTypes.FetchTypes();
         NodeTypes.FetchNodes();
         NodeCanvasManager.GetAllCanvasTypes();
         NodeEditorCallbacks.SetupReceivers();
         NodeEditorCallbacks.IssueOnEditorStartUp();
         GUIScaleUtility.CheckInit();
         NodeEditorInputSystem.SetupInput();
         initiated = GUIFunction;
     }
 }