示例#1
0
        public static void Init(NodeEditorTWWindow _inst)
        {
            NewTextureWangPopup window = ScriptableObject.CreateInstance <NewTextureWangPopup>();

            window.m_Parent = _inst;
            window.position = new Rect(_inst.canvasWindowRect.x + _inst.canvasWindowRect.width * 0.5f,
                                       _inst.canvasWindowRect.y + _inst.canvasWindowRect.height * 0.5f, 450, 350);
            window.titleContent = new GUIContent("New TextureWang Canvas");
            window.ShowUtility();
        }
        public void DrawSideWindow()
        {
            GUILayout.Label(new GUIContent("TextureWang ", "Opened Canvas path: " + openedCanvasPath), NodeEditorGUI.nodeLabelBold);

            if (GUILayout.Button(new GUIContent("Save Canvas", "Saves the Canvas to a Canvas Save File in the Assets Folder")))
            {
                string path = EditorUtility.SaveFilePanelInProject("Save Node Canvas", "Node Canvas", "asset", "", NodeEditor.editorPath + "Resources/Saves/");
                if (!string.IsNullOrEmpty(path))
                {
                    canvasCache.SaveNodeCanvas(path);
                }

/*
 *              string path = EditorUtility.SaveFilePanelInProject ("Save Node Canvas", m_LastLoadedName, "asset", "", NodeEditor.editorPath + "Resources/Saves/");
 *                          if (!string.IsNullOrEmpty(path))
 *                          {
 *                              SaveNodeCanvas(path);
 *
 *              }
 */
                if (m_NodeSelectionWindow != null)
                {
                    m_NodeSelectionWindow.ReInit();
                }
            }

            /*
             *          if (GUILayout.Button(new GUIContent("New Canvas",
             *                  "Create a copy")))
             *          {
             *              CreateEditorCopy();
             *          }
             */

            if (GUILayout.Button(new GUIContent("Load Canvas", "Loads the Canvas from a Canvas Save File in the Assets Folder")))
            {
                string path = EditorUtility.OpenFilePanel("Load Node Canvas", NodeEditor.editorPath + "Resources/Saves/", "asset");
                if (!path.Contains(Application.dataPath))
                {
                    if (!string.IsNullOrEmpty(path))
                    {
                        ShowNotification(new GUIContent("You should select an asset inside your project folder!"));
                    }
                }
                else
                {
                    NodeEditor.curEditorState = null;
                    canvasCache.LoadNodeCanvas(path);
                    canvasCache.NewEditorState();
                }
            }

            if (GUILayout.Button(new GUIContent("New TextureWang", "Create a new TextureWang Canvas")))
            {
                NewTextureWangPopup.Init(this);
            }


            if (GUILayout.Button(new GUIContent("Recalculate All",
                                                "Initiates complete recalculate. Usually does not need to be triggered manually.")))
            {
                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
                GUI.changed = false;
            }

            if (GUILayout.Button("Force Re-Init"))
            {
                NodeEditor.ReInit(true);
            }

            NodeEditorGUI.knobSize       = EditorGUILayout.IntSlider(new GUIContent("Handle Size", "The size of the Node Input/Output handles"), NodeEditorGUI.knobSize, 12, 20);
            canvasCache.editorState.zoom = EditorGUILayout.Slider(new GUIContent("Zoom", "Use the Mousewheel. Seriously."), canvasCache.editorState.zoom, 0.6f, 2);

            //miked            mainNodeCanvas.scaleMode = (ScaleMode)EditorGUILayout.EnumPopup(new GUIContent("ScaleMode", ""), mainNodeCanvas.scaleMode, GUILayout.MaxWidth(200));



            //        m_OpType = (TexOP)UnityEditor.EditorGUILayout.EnumPopup(new GUIContent("Type", "The type of calculation performed on Input 1"), m_OpType, GUILayout.MaxWidth(200));
            //            if (mainNodeCanvas != null)
            {
                //                EditorGUILayout.LabelField("width: " + mainNodeCanvas.m_TexWidth);
                //                EditorGUILayout.LabelField("height: " + mainNodeCanvas.m_TexHeight);
            }

/*
 *          if (NodeEditor.curEditorState == null)
 *          {
 *              Debug.Log("TWWindow has no editor state " + NodeEditor.curEditorState);
 *          }
 *          else if (NodeEditor.curEditorState.selectedNode == null)
 *          {
 *              Debug.Log("TWWindow has no Selected Node " + NodeEditor.curEditorState);
 *          }
 *          else
 *          {
 *              Debug.Log(" Selected Node " + NodeEditor.curEditorState.selectedNode);
 *          }
 */
            if (canvasCache.editorState != null && canvasCache.editorState.selectedNode != null)
            // if (Event.current.type != EventType.Ignore)
            {
                RTEditorGUI.Seperator();
                GUILayout.Label(canvasCache.editorState.selectedNode.name);
                RTEditorGUI.Seperator();
                canvasCache.editorState.selectedNode.DrawNodePropertyEditor();
                if (GUI.changed)
                {
                    NodeEditor.RecalculateFrom(PriorLoop(canvasCache.editorState.selectedNode));
                }
            }


            //            var assets = UnityEditor.AssetDatabase.FindAssets("NodeCanvas");
            //            foreach(var x in assets)
            //                GUILayout.Label(new GUIContent("Node Editor (" + x + ")", "Opened Canvas path: " ), NodeEditorGUI.nodeLabelBold);

            /*
             *          if (m_All == null)
             *              m_All = GetAtPath<NodeCanvas>("Node_Editor-master/Node_Editor/Resources/Saves");//Resources.LoadAll<NodeCanvas>(NodeEditor.editorPath + "Resources/Saves/");
             *
             *          scrollPos =EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Width(300), GUILayout.Height(600));
             *          guiStyle.fontSize = 20;
             *          guiStyle.fixedHeight = 20;
             *          foreach (var x in m_All)
             *               EditorGUILayout.SelectableLabel("(" + x.name + ")", guiStyle);
             *          EditorGUILayout.EndScrollView();
             */
        }
        public void DrawSideWindow()
        {
            string canvasName = "Node Canvas";

            if (canvasCache != null && !string.IsNullOrEmpty(canvasCache.openedCanvasPath))
            {
                canvasName = canvasCache.openedCanvasPath.Substring(canvasCache.openedCanvasPath.LastIndexOf(@"/") + 1);
                canvasName = canvasName.Replace(".asset", "");
            }

            GUILayout.Label(new GUIContent(canvasName));

            if (GUILayout.Button(new GUIContent("Save Canvas", "Saves the Canvas to a Canvas Save File in the Assets Folder")))
            {
                string lastpath = NodeEditor.editorPathLoadSave + "Saves/";
                lastpath = GetLastUsedPath(lastpath);
                string path = EditorUtility.SaveFilePanelInProject("Save Node Canvas", canvasName, "asset", "", lastpath);
                if (!string.IsNullOrEmpty(path))
                {
                    canvasCache.SaveNodeCanvas(path);
                }

/*
 *              string path = EditorUtility.SaveFilePanelInProject ("Save Node Canvas", m_LastLoadedName, "asset", "", NodeEditor.editorPath + "Resources/Saves/");
 *                          if (!string.IsNullOrEmpty(path))
 *                          {
 *                              SaveNodeCanvas(path);
 *
 *              }
 */
                if (m_NodeSelectionWindow != null)
                {
                    m_NodeSelectionWindow.ReInit();
                }
            }

            /*
             *          if (GUILayout.Button(new GUIContent("New Canvas",
             *                  "Create a copy")))
             *          {
             *              CreateEditorCopy();
             *          }
             */

            if (GUILayout.Button(new GUIContent("Load Canvas", "Loads the Canvas from a Canvas Save File in the Assets Folder")))
            {
                string lastpath = NodeEditor.editorPathLoadSave + "Saves/";
                lastpath = GetLastUsedPath(lastpath);
                Debug.Log(" last path for load canvas" + lastpath);
                string path = EditorUtility.OpenFilePanel("Load Node Canvas", lastpath, "asset");

                if (!path.Contains(Application.dataPath))
                {
                    if (!string.IsNullOrEmpty(path))
                    {
                        ShowNotification(new GUIContent("You should select an asset inside your project folder!"));
                    }
                }
                else
                {
                    NodeEditor.curEditorState = null;
                    canvasCache.LoadNodeCanvas(path);
                    canvasCache.NewEditorState();
                }
                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
            }

            if (GUILayout.Button(new GUIContent("New TextureWang", "Create a new TextureWang Canvas")))
            {
                NewTextureWangPopup.Init(this);
            }


            if (GUILayout.Button(new GUIContent("Recalculate All", "Initiates complete recalculate. Usually does not need to be triggered manually.")))
            {
                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
                GUI.changed = false;
            }
            if (GUILayout.Button(new GUIContent("Recalculate All Export PNG'S", "Initiates complete recalculate. Usually does not need to be triggered manually.")))
            {
                UnityTextureOutput.ms_ExportPNG = true;
                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
                GUI.changed = false;
                UnityTextureOutput.ms_ExportPNG = false;
            }
            canvasCache.nodeCanvas.m_PreviewAnimation     = GUILayout.Toggle(canvasCache.nodeCanvas.m_PreviewAnimation, "Preview Animation");
            canvasCache.nodeCanvas.m_ExportToExternalPath = GUILayout.Toggle(canvasCache.nodeCanvas.m_ExportToExternalPath, "Export To External Path");
            if (GUILayout.Button(new GUIContent("Browse External path", "Sets External export path outside asset folder ")))
            {
                canvasCache.nodeCanvas.m_ExternalPath = EditorUtility.SaveFolderPanel("Set External Export Path", canvasCache.nodeCanvas.m_ExternalPath, "");
            }
            canvasCache.nodeCanvas.m_ExternalPath    = GUILayout.TextField(canvasCache.nodeCanvas.m_ExternalPath);
            UnityTextureOutput.ms_ExportExternal     = canvasCache.nodeCanvas.m_ExportToExternalPath;
            UnityTextureOutput.ms_ExportExternalPath = canvasCache.nodeCanvas.m_ExternalPath;


            if (GUILayout.Button(new GUIContent("Recalculate All Animated Export PNG'S", "Initiates complete recalculate. ")))
            {
                UnityTextureOutput.ms_ExportPNG = true;
                int   count = 0;
                float step  = 1.0f / canvasCache.nodeCanvas.m_FrameCount;
                UnityTextureOutput.ms_ExportPNGFrameCount = canvasCache.nodeCanvas.m_FrameCount;
                for (float f = 0; f <= 1.001f; f += step)
                {
                    UnityTextureOutput.ms_ExportPNGAnimated = true;
                    UnityTextureOutput.ms_ExportPNGFrame    = count++;
                    foreach (var x in canvasCache.nodeCanvas.nodes)
                    {
                        if (x is InputNodeAnimated)
                        {
                            var ina = x as InputNodeAnimated;
                            ina.m_Value.Set(f);
                        }
                        if (x is UnityTextureOutput || x is UnityTextureOutputMetalicAndRoughness ||
                            x is UnityTextureOutputRGBA)
                        {
                            //x.m_DirtyID = -1;
                        }
                    }
                    NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
                }
                GUI.changed = false;

                UnityTextureOutput.ms_ExportPNG         = false;
                UnityTextureOutput.ms_ExportPNGAnimated = false;
            }

            //            if (GUILayout.Button ("Force Re-Init"))
            //				NodeEditor.ReInit (true);
            if (GUILayout.Button(new GUIContent("Double All texture Sizes", "")))
            {
                foreach (var n in canvasCache.nodeCanvas.nodes)
                {
                    if (n is TextureNode)
                    {
                        var tn = n as TextureNode;
                        tn.m_TexWidth  *= 2;
                        tn.m_TexHeight *= 2;
                    }
                }
                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
            }
            if (GUILayout.Button(new GUIContent("Set All Selected to Default Size", "")))
            {
                foreach (var n in canvasCache.editorState.selectedNodes)
                {
                    if (n is TextureNode)
                    {
                        var tn = n as TextureNode;
                        tn.m_TexWidth  = canvasCache.nodeCanvas.m_DefaultTextureWidth;
                        tn.m_TexHeight = canvasCache.nodeCanvas.m_DefaultTextureHeight;
                    }
                }

                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
            }

            if (GUILayout.Button(new GUIContent("Halve All texture Sizes", "")))
            {
                foreach (var n in canvasCache.nodeCanvas.nodes)
                {
                    if (n is TextureNode)
                    {
                        var tn = n as TextureNode;
                        tn.m_TexWidth  >>= 1;
                        tn.m_TexHeight >>= 1;
                    }
                }
                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
            }

            bool changed = GUI.changed;

            GUI.changed                  = false;
            NodeEditorGUI.knobSize       = EditorGUILayout.IntSlider(new GUIContent("Handle Size", "The size of the Node Input/Output handles"), NodeEditorGUI.knobSize, 12, 20);
            canvasCache.editorState.zoom = EditorGUILayout.Slider(new GUIContent("Zoom", "Use the Mousewheel. Seriously."), canvasCache.editorState.zoom, 0.2f, 4);
            m_OpenAppearance             = EditorGUILayout.Foldout(m_OpenAppearance, "");
            if (m_OpenAppearance)
            {
                Node.m_DropShadowMult = EditorGUILayout.Slider(new GUIContent("DropShadow", ""), Node.m_DropShadowMult,
                                                               0.0f, 1);
                Node.m_DropShadowMult2 = EditorGUILayout.Slider(new GUIContent("DropShadow Wires", ""),
                                                                Node.m_DropShadowMult2, 0.0f, 1);
                Node.m_WireSize  = EditorGUILayout.Slider(new GUIContent("m_WireSize", ""), Node.m_WireSize, 0.0f, 30);
                Node.m_WireSize2 = EditorGUILayout.Slider(new GUIContent("WireSize Shadow", ""), Node.m_WireSize2, 0.0f,
                                                          50);
                Node.m_Saturation    = EditorGUILayout.Slider(new GUIContent("Saturation", ""), Node.m_Saturation, 0.0f, 1);
                Node.m_WireColbright = EditorGUILayout.Slider(new GUIContent("m_WireColbright", ""),
                                                              Node.m_WireColbright, 0.0f, 1);

                Node.m_DropShadowOffset = EditorGUILayout.Slider(new GUIContent("DropShadowOffset", ""),
                                                                 Node.m_DropShadowOffset, -50.0f, 50);
                Node.m_DropShadowExpand = EditorGUILayout.Slider(new GUIContent("m_DropShadowExpand", ""),
                                                                 Node.m_DropShadowExpand, 0f, 50);
            }
            bool changeView = GUI.changed;

            GUI.changed = changed;
            if (canvasCache.nodeCanvas != null)
            {
                canvasCache.nodeCanvas.m_FrameCount =
                    EditorGUILayout.IntSlider(new GUIContent("Animation Frame Count", ""),
                                              canvasCache.nodeCanvas.m_FrameCount, 1, 1024);
                canvasCache.nodeCanvas.m_DefaultTextureWidth  = EditorGUILayout.IntSlider(new GUIContent("Default tex Width", ""), canvasCache.nodeCanvas.m_DefaultTextureWidth, 1, 4096);
                canvasCache.nodeCanvas.m_DefaultTextureHeight = EditorGUILayout.IntSlider(new GUIContent("Default tex Height", ""), canvasCache.nodeCanvas.m_DefaultTextureHeight, 1, 4096);

                canvasCache.nodeCanvas.m_DefaultChannelType = (ChannelType)UnityEditor.EditorGUILayout.EnumPopup(new GUIContent("pixel Depth", ""), canvasCache.nodeCanvas.m_DefaultChannelType);
            }


            //miked            mainNodeCanvas.scaleMode = (ScaleMode)EditorGUILayout.EnumPopup(new GUIContent("ScaleMode", ""), mainNodeCanvas.scaleMode, GUILayout.MaxWidth(200));



            //        m_OpType = (TexOP)UnityEditor.EditorGUILayout.EnumPopup(new GUIContent("Type", "The type of calculation performed on Input 1"), m_OpType, GUILayout.MaxWidth(200));
            //            if (mainNodeCanvas != null)
            {
                //                EditorGUILayout.LabelField("width: " + mainNodeCanvas.m_TexWidth);
                //                EditorGUILayout.LabelField("height: " + mainNodeCanvas.m_TexHeight);
            }

/*
 *          if (NodeEditor.curEditorState == null)
 *          {
 *              Debug.Log("TWWindow has no editor state " + NodeEditor.curEditorState);
 *          }
 *          else if (NodeEditor.curEditorState.selectedNode == null)
 *          {
 *              Debug.Log("TWWindow has no Selected Node " + NodeEditor.curEditorState);
 *          }
 *          else
 *          {
 *              Debug.Log(" Selected Node " + NodeEditor.curEditorState.selectedNode);
 *          }
 */
            if (canvasCache.editorState != null && canvasCache.editorState.selectedNode != null)
            // if (Event.current.type != EventType.Ignore)
            {
                RTEditorGUI.Seperator();
                GUILayout.Label(canvasCache.editorState.selectedNode.name);
                RTEditorGUI.Seperator();
                if (canvasCache.editorState.selectedNode is SubTreeNode)
                {
                    if (GUILayout.Button("Edit Sub Canvas"))
                    {
                        string NodeCanvasPath = AssetDatabase.GUIDToAssetPath((canvasCache.editorState.selectedNode as SubTreeNode).m_CanvasGuid);

                        NodeEditor.curEditorState = null;
                        canvasCache.LoadNodeCanvas(NodeCanvasPath);
                        canvasCache.NewEditorState();
                    }
                }
                if (canvasCache.editorState.selectedNode)
                {
                    canvasCache.editorState.selectedNode.DrawNodePropertyEditor();
                }
                if (GUI.changed && canvasCache.editorState.selectedNode)
                {
                    NodeEditor.RecalculateFrom(PriorLoop(canvasCache.editorState.selectedNode));
                }
                else
                if (changeView)
                {
                    Repaint();
                    Debug.Log("repaint 5");
                }
            }



            //            var assets = UnityEditor.AssetDatabase.FindAssets("NodeCanvas");
            //            foreach(var x in assets)
            //                GUILayout.Label(new GUIContent("Node Editor (" + x + ")", "Opened Canvas path: " ), NodeEditorGUI.nodeLabelBold);

            /*
             *          if (m_All == null)
             *              m_All = GetAtPath<NodeCanvas>("Node_Editor-master/Node_Editor/Resources/Saves");//Resources.LoadAll<NodeCanvas>(NodeEditor.editorPath + "Resources/Saves/");
             *
             *          scrollPos =EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Width(300), GUILayout.Height(600));
             *          guiStyle.fontSize = 20;
             *          guiStyle.fixedHeight = 20;
             *          foreach (var x in m_All)
             *               EditorGUILayout.SelectableLabel("(" + x.name + ")", guiStyle);
             *          EditorGUILayout.EndScrollView();
             */
        }
        public void DrawSideWindow()
        {
            string canvasName = "Node Canvas";

            if (canvasCache != null && !string.IsNullOrEmpty(canvasCache.openedCanvasPath))
            {
                canvasName = canvasCache.openedCanvasPath.Substring(canvasCache.openedCanvasPath.LastIndexOf(@"/") + 1);
                canvasName = canvasName.Replace(".asset", "");
            }

            GUILayout.Label(new GUIContent(canvasName));

            if (GUILayout.Button(new GUIContent("Save Canvas", "Saves the Canvas to a Canvas Save File in the Assets Folder")))
            {
                string lastpath = NodeEditor.editorPathLoadSave + "Saves/";
                lastpath = GetLastUsedPath(lastpath);
                string path = EditorUtility.SaveFilePanelInProject("Save Node Canvas", canvasName, "asset", "", lastpath);
                if (!string.IsNullOrEmpty(path))
                {
                    canvasCache.SaveNodeCanvas(path);
                }

/*
 *              string path = EditorUtility.SaveFilePanelInProject ("Save Node Canvas", m_LastLoadedName, "asset", "", NodeEditor.editorPath + "Resources/Saves/");
 *                          if (!string.IsNullOrEmpty(path))
 *                          {
 *                              SaveNodeCanvas(path);
 *
 *              }
 */
                if (m_NodeSelectionWindow != null)
                {
                    m_NodeSelectionWindow.ReInit();
                }
            }

            /*
             *          if (GUILayout.Button(new GUIContent("New Canvas",
             *                  "Create a copy")))
             *          {
             *              CreateEditorCopy();
             *          }
             */

            if (GUILayout.Button(new GUIContent("Load Canvas", "Loads the Canvas from a Canvas Save File in the Assets Folder")))
            {
                string lastpath = NodeEditor.editorPathLoadSave + "Saves/";
                lastpath = GetLastUsedPath(lastpath);
                string path = EditorUtility.OpenFilePanel("Load Node Canvas", lastpath, "asset");

                if (!path.Contains(Application.dataPath))
                {
                    if (!string.IsNullOrEmpty(path))
                    {
                        ShowNotification(new GUIContent("You should select an asset inside your project folder!"));
                    }
                }
                else
                {
                    NodeEditor.curEditorState = null;
                    canvasCache.LoadNodeCanvas(path);
                    canvasCache.NewEditorState();
                }
                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
            }

            if (GUILayout.Button(new GUIContent("New TextureWang", "Create a new TextureWang Canvas")))
            {
                NewTextureWangPopup.Init(this);
            }


            if (GUILayout.Button(new GUIContent("Recalculate All", "Initiates complete recalculate. Usually does not need to be triggered manually.")))
            {
                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
                GUI.changed = false;
            }
            if (GUILayout.Button(new GUIContent("Recalculate All Export PNG'S", "Initiates complete recalculate. Usually does not need to be triggered manually.")))
            {
                UnityTextureOutput.ms_ExportPNG = true;
                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
                GUI.changed = false;
                UnityTextureOutput.ms_ExportPNG = false;
            }

//            if (GUILayout.Button ("Force Re-Init"))
//				NodeEditor.ReInit (true);
            if (GUILayout.Button(new GUIContent("Double All texture Sizes", "")))
            {
                foreach (var n in canvasCache.nodeCanvas.nodes)
                {
                    if (n is TextureNode)
                    {
                        var tn = n as TextureNode;
                        tn.m_TexWidth  *= 2;
                        tn.m_TexHeight *= 2;
                    }
                }
                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
            }
            if (GUILayout.Button(new GUIContent("Halve All texture Sizes", "")))
            {
                foreach (var n in canvasCache.nodeCanvas.nodes)
                {
                    if (n is TextureNode)
                    {
                        var tn = n as TextureNode;
                        tn.m_TexWidth  >>= 1;
                        tn.m_TexHeight >>= 1;
                    }
                }
                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
            }

            NodeEditorGUI.knobSize       = EditorGUILayout.IntSlider(new GUIContent("Handle Size", "The size of the Node Input/Output handles"), NodeEditorGUI.knobSize, 12, 20);
            canvasCache.editorState.zoom = EditorGUILayout.Slider(new GUIContent("Zoom", "Use the Mousewheel. Seriously."), canvasCache.editorState.zoom, 0.2f, 4);

            if (canvasCache.nodeCanvas != null)
            {
                canvasCache.nodeCanvas.m_DefaultTextureWidth =
                    EditorGUILayout.IntSlider(new GUIContent("Default tex Width", ""),
                                              canvasCache.nodeCanvas.m_DefaultTextureWidth, 1, 4096);
                canvasCache.nodeCanvas.m_DefaultTextureHeight =
                    EditorGUILayout.IntSlider(new GUIContent("Default tex Height", ""),
                                              canvasCache.nodeCanvas.m_DefaultTextureHeight, 1, 4096);

                canvasCache.nodeCanvas.m_DefaultChannelType = (ChannelType)UnityEditor.EditorGUILayout.EnumPopup(new GUIContent("pixel Depth", ""), canvasCache.nodeCanvas.m_DefaultChannelType);
            }


            //miked            mainNodeCanvas.scaleMode = (ScaleMode)EditorGUILayout.EnumPopup(new GUIContent("ScaleMode", ""), mainNodeCanvas.scaleMode, GUILayout.MaxWidth(200));



            //        m_OpType = (TexOP)UnityEditor.EditorGUILayout.EnumPopup(new GUIContent("Type", "The type of calculation performed on Input 1"), m_OpType, GUILayout.MaxWidth(200));
            //            if (mainNodeCanvas != null)
            {
                //                EditorGUILayout.LabelField("width: " + mainNodeCanvas.m_TexWidth);
                //                EditorGUILayout.LabelField("height: " + mainNodeCanvas.m_TexHeight);
            }

/*
 *          if (NodeEditor.curEditorState == null)
 *          {
 *              Debug.Log("TWWindow has no editor state " + NodeEditor.curEditorState);
 *          }
 *          else if (NodeEditor.curEditorState.selectedNode == null)
 *          {
 *              Debug.Log("TWWindow has no Selected Node " + NodeEditor.curEditorState);
 *          }
 *          else
 *          {
 *              Debug.Log(" Selected Node " + NodeEditor.curEditorState.selectedNode);
 *          }
 */
            if (canvasCache.editorState != null && canvasCache.editorState.selectedNode != null)
            // if (Event.current.type != EventType.Ignore)
            {
                RTEditorGUI.Seperator();
                GUILayout.Label(canvasCache.editorState.selectedNode.name);
                RTEditorGUI.Seperator();
                if (canvasCache.editorState.selectedNode is SubTreeNode)
                {
                    if (GUILayout.Button("Edit Sub Canvas"))
                    {
                        string NodeCanvasPath = AssetDatabase.GUIDToAssetPath((canvasCache.editorState.selectedNode as SubTreeNode).m_CanvasGuid);

                        NodeEditor.curEditorState = null;
                        canvasCache.LoadNodeCanvas(NodeCanvasPath);
                        canvasCache.NewEditorState();
                    }
                }
                canvasCache.editorState.selectedNode.DrawNodePropertyEditor();
                if (GUI.changed)
                {
                    NodeEditor.RecalculateFrom(PriorLoop(canvasCache.editorState.selectedNode));
                }
            }


            //            var assets = UnityEditor.AssetDatabase.FindAssets("NodeCanvas");
            //            foreach(var x in assets)
            //                GUILayout.Label(new GUIContent("Node Editor (" + x + ")", "Opened Canvas path: " ), NodeEditorGUI.nodeLabelBold);

            /*
             *          if (m_All == null)
             *              m_All = GetAtPath<NodeCanvas>("Node_Editor-master/Node_Editor/Resources/Saves");//Resources.LoadAll<NodeCanvas>(NodeEditor.editorPath + "Resources/Saves/");
             *
             *          scrollPos =EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Width(300), GUILayout.Height(600));
             *          guiStyle.fontSize = 20;
             *          guiStyle.fixedHeight = 20;
             *          foreach (var x in m_All)
             *               EditorGUILayout.SelectableLabel("(" + x.name + ")", guiStyle);
             *          EditorGUILayout.EndScrollView();
             */
        }