private void OnEnable()
        {
            Debug.Log("NodeEditorTWWindow enabled");
            _editor = this;
            NodeEditor.checkInit(false);

            NodeEditorCallbacks.OnLoadCanvas -= OnLoadCanvas;
            NodeEditorCallbacks.OnLoadCanvas += OnLoadCanvas;

            NodeEditorInputControls.m_FinishedDupe -= _editor.RecalcAll;
            NodeEditorInputControls.m_FinishedDupe += _editor.RecalcAll;


            NodeEditor.ClientRepaints -= Repaint;
            NodeEditor.ClientRepaints += Repaint;

            EditorLoadingControl.justLeftPlayMode -= NormalReInit;
            EditorLoadingControl.justLeftPlayMode += NormalReInit;
            // Here, both justLeftPlayMode and justOpenedNewScene have to act because of timing
            EditorLoadingControl.justOpenedNewScene -= NormalReInit;
            EditorLoadingControl.justOpenedNewScene += NormalReInit;

            SceneView.onSceneGUIDelegate -= OnSceneGUI;
            SceneView.onSceneGUIDelegate += OnSceneGUI;
            string assetPath = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this));

            if (assetPath.Length > 1)
            {
//                Debug.LogError("asset path " + assetPath);
                string path = Path.GetDirectoryName(assetPath);
                // Setup Cache
                canvasCache = new NodeEditorUserCache(path);
            }
            else
            {
                Debug.LogError("UNKNOWN asset path " + assetPath);
                canvasCache = new NodeEditorUserCache(); //path);
            }
            bool loadCache = true;

            if (!Shader.Find("Hidden/TextureOps"))
            {
                string shadername1 = "http://54.237.244.93/TextureOps" + NodeEditorTWWindow.m_Version + ".txt";
                wwwShader1 = new WWW(shadername1);
                loadCache  = false;
            }

            canvasCache.SetupCacheEvents(loadCache);

            m_NodeSelectionWindow = MultiColumnWindow.GetWindow(this);

            m_InspectorWindow          = NodeInspectorWindow.Init(this);
            NodeEditor.ClientRepaints += m_InspectorWindow.Repaint;
            StartTextureWangPopup.Init(this);

            m_InspectorWindow.m_Source     = this;
            NodeEditorCallbacks.OnAddNode -= NewNodeCallback;
            NodeEditorCallbacks.OnAddNode += NewNodeCallback;
        }
        public MultiColumnTreeView(TreeViewState state, MultiColumnHeader multicolumnHeader, TreeModel <ExcelTreeElement> model, MultiColumnWindow parent) : base(state, multicolumnHeader, model)
        {
            //Assert.AreEqual(m_SortOptions.Length , Enum.GetValues(typeof(MyColumns)).Length, "Ensure number of sort options are in sync with number of MyColumns enum values");

            // Custom setup
            rowHeight = kRowHeights;
            columnIndexForTreeFoldouts    = 0;
            showAlternatingRowBackgrounds = true;
            showBorder           = true;
            customFoldoutYOffset = (kRowHeights - EditorGUIUtility.singleLineHeight) * 0.5f; // center foldout in the row since we also center content. See RowGUI
                                                                                             //extraSpaceBeforeIconAndLabel = kToggleWidth;
                                                                                             //multicolumnHeader.sortingChanged += OnSortingChanged;
            m_parent = parent;
            Reload();
        }
        private void OnEnable()
        {
            Debug.Log("NodeEditorTWWindow enabled");
            _editor = this;
            NodeEditor.checkInit(false);

            NodeEditorCallbacks.OnLoadCanvas += OnLoadCanvas;

            NodeEditor.ClientRepaints -= Repaint;
            NodeEditor.ClientRepaints += Repaint;

            EditorLoadingControl.justLeftPlayMode -= NormalReInit;
            EditorLoadingControl.justLeftPlayMode += NormalReInit;
            // Here, both justLeftPlayMode and justOpenedNewScene have to act because of timing
            EditorLoadingControl.justOpenedNewScene -= NormalReInit;
            EditorLoadingControl.justOpenedNewScene += NormalReInit;

            SceneView.onSceneGUIDelegate -= OnSceneGUI;
            SceneView.onSceneGUIDelegate += OnSceneGUI;
            string assetPath = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this));

            if (assetPath.Length > 1)
            {
                Debug.LogError("asset path " + assetPath);
                string path = Path.GetDirectoryName(assetPath);
                // Setup Cache
                canvasCache = new NodeEditorUserCache(path);
            }
            else
            {
                Debug.LogError("UNKNOWN asset path " + assetPath);
                canvasCache = new NodeEditorUserCache(); //path);
            }
            canvasCache.SetupCacheEvents();

            m_NodeSelectionWindow = MultiColumnWindow.GetWindow(this);

            m_InspectorWindow          = NodeInspectorWindow.Init(this);
            NodeEditor.ClientRepaints += m_InspectorWindow.Repaint;
            StartTextureWangPopup.Init(this);

            m_InspectorWindow.m_Source = this;
        }