/// <summary>
        /// Setup of the base framework. Enough to manage and calculate canvases.
        /// </summary>
        private static void setupBaseFramework()
        {
            CheckEditorPath();

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

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

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

            // Init input
            NodeEditorInputSystem.SetupInput();

                #if UNITY_EDITOR
            UnityEditor.EditorApplication.update -= Update;
            UnityEditor.EditorApplication.update += Update;
                #endif

            initiatedBase = true;
        }
Example #2
0
        /// <summary>
        /// Re-Inits the NodeCanvas regardless of whetehr it was initiated before
        /// </summary>
        public static void ReInit(bool GUIFunction)
        {
            CheckEditorPath();

            // Init Resource system. Can be called anywhere else, too, if it's needed before.
            ResourceManager.SetDefaultResourcePath(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.CheckInit();

            // Init input
            NodeEditorInputSystem.SetupInput();

        #if UNITY_EDITOR
            UnityEditor.EditorApplication.update -= Update;
            UnityEditor.EditorApplication.update += Update;
            RepaintClients();
        #endif
            initiated = GUIFunction;
        }
 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;
     }
 }