Пример #1
0
        public void OnGUI()
        {
            cache.AssureCanvas();
            NodeEditor.checkInit(true);
            if (NodeEditor.InitiationError)
            {
                GUILayout.Label("Initiation failed! Check console for more information!");
                return;
            }

            try
            {
                GUI.BeginGroup(screenSize? screenRect : specifiedRootRect, NodeEditorGUI.nodeSkin.box);
                NodeEditorGUI.StartNodeGUI();

                canvasRect                   = screenSize? screenRect : specifiedCanvasRect;
                canvasRect.width            -= 200;
                cache.editorState.canvasRect = canvasRect;
                NodeEditor.DrawCanvas(cache.nodeCanvas, cache.editorState);

                GUILayout.BeginArea(new Rect(canvasRect.x + cache.editorState.canvasRect.width, cache.editorState.canvasRect.y, 200, cache.editorState.canvasRect.height), NodeEditorGUI.nodeSkin.box);
                SideGUI();
                GUILayout.EndArea();

                NodeEditorGUI.EndNodeGUI();
                GUI.EndGroup();
            }
            catch (UnityException e)
            {             // on exceptions in drawing flush the canvas to avoid locking the ui.
                cache.NewNodeCanvas();
                NodeEditor.ReInit(true);
                Debug.LogError("Unloaded Canvas due to exception in Draw!");
                Debug.LogException(e);
            }
        }
Пример #2
0
 private void AssureSetup()
 {
     canvasCache.AssureCanvas();
     if (editorInterface == null)
     {             // Setup editor interface
         editorInterface             = new NodeEditorInterface();
         editorInterface.canvasCache = canvasCache;
     }
 }
Пример #3
0
        private void AssureSetup()
        {
            if (canvasCache == null)
            {
                AssureCache();
            }
            else if (!AssetDatabase.IsValidFolder(ResourceManager.StripTrailingSeparator(canvasCache.GetCachePath())))
            {
                AssureCache();
            }
            canvasCache.AssureCanvas();

            if (editorInterface == null)
            {             // Setup editor interface
                editorInterface                        = new NodeEditorInterface();
                editorInterface.canvasCache            = canvasCache;
                editorInterface.ShowNotificationAction = ShowNotification;
            }
        }
        private void OnGUI()
        {
            // Initiation
            NodeEditor.checkInit(true);
            if (NodeEditor.InitiationError || canvasCache == null)
            {
                GUILayout.Label("Node Editor Initiation failed! Check console for more information!");
                return;
            }
            AssureEditor();
            canvasCache.AssureCanvas();

            // Specify the Canvas rect in the EditorState, currently disabled for dynamic sidebar resizing
            // canvasCache.editorState.canvasRect = canvasWindowRect;
            // If you want to use GetRect:
//			Rect canvasRect = GUILayoutUtility.GetRect (600, 600);
//			if (Event.current.type != EventType.Layout)
//				mainEditorState.canvasRect = canvasRect;
            NodeEditorGUI.StartNodeGUI("NodeEditorWindow", true);

            canvasCache.editorState.canvasRect = canvasWindowRect;

            // Perform drawing with error-handling
            try
            {
                NodeEditor.DrawCanvas(canvasCache.nodeCanvas, canvasCache.editorState);
            }
            catch (UnityException e)
            {             // on exceptions in drawing flush the canvas to avoid locking the ui.
                canvasCache.NewNodeCanvas();
                NodeEditor.ReInit(true);
                Debug.LogError("Unloaded Canvas due to an exception during the drawing phase!");
                Debug.LogException(e);
            }

            // Draw Toolbar
            DrawToolbarGUI();

            if (showSideWindow)
            {             // Draw Side Window
                sideWindowWidth = Math.Min(600, Math.Max(200, (int)(position.width / 5)));
                GUILayout.BeginArea(sideWindowRect, GUI.skin.box);
                DrawSideWindow();
                GUILayout.EndArea();
            }

            if (showModalPanel)
            {
                BeginWindows();
                modalWindowRect = GUILayout.Window(0, modalWindowRect, DoModalWindow, "Save to Scene");
                EndWindows();
            }

            NodeEditorGUI.EndNodeGUI();
        }
Пример #5
0
        private void AssureSetup()
        {
            if (canvasCache == null)
            {             // Create cache
                canvasCache = new NodeEditorUserCache(Path.GetDirectoryName(AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this))));
            }
            canvasCache.AssureCanvas();

            NodeEditorInterface.GetInstance().canvasCache            = canvasCache;
            NodeEditorInterface.GetInstance().ShowNotificationAction = ShowNotification;
        }
 private void AssureSetup()
 {
     if (_canvasCache == null)
     { // Create cache
         _canvasCache = new NodeEditorUserCache();
     }
     _canvasCache.AssureCanvas();
     if (_editorInterface == null)
     { // Setup editor interface
         _editorInterface                        = new AbilityEditorInterface();
         _editorInterface.canvasCache            = _canvasCache;
         _editorInterface.ShowNotificationAction = ShowNotification;
     }
 }
Пример #7
0
 private void AssureSetup()
 {
     if (canvasCache == null)
     {             // Create cache and load startup-canvas
         canvasCache = new NodeEditorUserCache();
         canvasCache.SetCanvas(NodeEditorSaveManager.CreateWorkingCopy(canvas));
     }
     canvasCache.AssureCanvas();
     if (editorInterface == null)
     {             // Setup editor interface
         editorInterface             = NodeEditorInterface.GetInstance();
         editorInterface.canvasCache = canvasCache;
     }
 }
        private void AssureSetup()
        {
            if (canvasCache == null)
            {
                // Create cache
                canvasCache = new NodeEditorUserCache();
            }

            canvasCache.AssureCanvas();
            if (editorInterface == null)
            {
                // Setup editor interface
                editorInterface                        = new NodeEditorInterface();
                editorInterface.canvasCache            = canvasCache;
                editorInterface.ShowNotificationAction = ShowNotification;
            }
        }
Пример #9
0
 private void AssureSetup()
 {
     if (canvasCache == null)
     {             // Create cache and load startup-canvas
         canvasCache = new NodeEditorUserCache();
         if (canvas != null)
         {
             canvasCache.SetCanvas(NodeEditorSaveManager.CreateWorkingCopy(canvas));
         }
         else if (!string.IsNullOrEmpty(loadSceneName))
         {
             canvasCache.LoadSceneNodeCanvas(loadSceneName);
         }
     }
     canvasCache.AssureCanvas();
     if (editorInterface == null)
     {             // Setup editor interface
         editorInterface             = new NodeEditorInterface();
         editorInterface.canvasCache = canvasCache;
     }
 }
Пример #10
0
        private void OnGUI()
        {
/*
 *          if (NodeEditor.curEditorState == null)
 *          {
 *              Debug.Log("OnGUI::TWWindow has no editor state " + NodeEditor.curEditorState+"actual editor state "+ canvasCache.editorState);
 *          }
 *          else if (NodeEditor.curEditorState.selectedNode == null)
 *          {
 *              Debug.Log("OnGUI::TWWindow has no Selected Node " + NodeEditor.curEditorState);
 *          }
 *          else
 *          {
 *              Debug.Log("OnGUI:: Selected Node " + NodeEditor.curEditorState.selectedNode);
 *          }
 */
            // Initiation
            NodeEditor.checkInit(true);
            if (NodeEditor.InitiationError)
            {
                GUILayout.Label("Node Editor Initiation failed! Check console for more information!");
                return;
            }
            AssureEditor();
            canvasCache.AssureCanvas();

            // Specify the Canvas rect in the EditorState
            canvasCache.editorState.canvasRect = canvasWindowRect;
            // If you want to use GetRect:
            //			Rect canvasRect = GUILayoutUtility.GetRect (600, 600);
            //			if (Event.current.type != EventType.Layout)
            //				mainEditorState.canvasRect = canvasRect;
            NodeEditorGUI.StartNodeGUI();

            // Perform drawing with error-handling
            try
            {
                NodeEditor.DrawCanvas(canvasCache.nodeCanvas, canvasCache.editorState);
            }
            catch (UnityException e)
            { // on exceptions in drawing flush the canvas to avoid locking the ui.
                canvasCache.NewNodeCanvas();
                NodeEditor.ReInit(true);
                Debug.LogError("Unloaded Canvas due to an exception during the drawing phase!");
                Debug.LogException(e);
            }



            // Draw Side Window
            //sideWindowWidth = Math.Min(600, Math.Max(200, (int)(position.width / 5)));
            //GUILayout.BeginArea(sideWindowRect, GUI.skin.box);
            //DrawSideWindow();
            //GUILayout.EndArea();


            NodeEditorGUI.EndNodeGUI();
//            if (Event.current.type == EventType.Repaint)
//                m_InspectorWindow.Repaint();

/*
 *          //if (Event.current.type == EventType.Repaint)
 *          {
 *              if (mainEditorState.selectedNode != mainEditorState.wantselectedNode)
 *              {
 *                  mainEditorState.selectedNode = mainEditorState.wantselectedNode;
 *                  NodeEditor.RepaintClients();
 *                  Repaint();
 *              }
 *
 *          }
 */
            if (!m_Docked)
            {
                Docker.Dock(this, m_InspectorWindow, Docker.DockPosition.Right);
                Docker.Dock(this, m_NodeSelectionWindow, Docker.DockPosition.Left);
                m_Docked = true;
            }
        }
        private void OnGUI()
        {
            if (wwwShader1 != null)
            {
                if (wwwShader1.isDone)
                {
                    string pathShader = "Assets/TextureWang/Shaders/TextureOps.shader";
                    pathShader = pathShader.Replace("/", "" + Path.DirectorySeparatorChar);

                    File.WriteAllBytes(pathShader, wwwShader1.bytes);
                    AssetDatabase.ImportAsset(pathShader, ImportAssetOptions.ForceSynchronousImport);
                    wwwShader1 = null;
                }
                Repaint();
                Debug.Log("repaint 2");
            }

            if (canvasCache.nodeCanvas.m_PreviewAnimation)
            {
                if (m_SW == null)
                {
                    m_SW = Stopwatch.StartNew();
                }
                m_AnimValue += (m_SW.ElapsedMilliseconds - m_LastTime) / 3000.0f;
                if (m_AnimValue < 0)
                {
                    m_AnimValue = 0;
                }
                m_LastTime = m_SW.ElapsedMilliseconds;
                if (m_AnimValue > 1.0f)
                {
                    m_AnimValue = 0.0f;
                }
                foreach (var x in canvasCache.nodeCanvas.nodes)
                {
                    if (x is InputNodeAnimated)
                    {
                        var ina = x as InputNodeAnimated;
                        ina.m_Value.Set(m_AnimValue);
                    }
                }
                NodeEditor.RecalculateAll(canvasCache.nodeCanvas);
                Repaint();
                Debug.Log("repaint 3");
            }
            else
            {
                m_AnimValue = 0;
            }

            if (m_ReplaceNode != null && !OverlayGUI.HasPopupControl() && ms_InputInfo != null)
            {
                NodeEditorInputSystem.ShowContextMenu(ms_InputInfo);
                ms_InputInfo = null;
            }

/*
 *          if (NodeEditor.curEditorState == null)
 *          {
 *              Debug.Log("OnGUI::TWWindow has no editor state " + NodeEditor.curEditorState+"actual editor state "+ canvasCache.editorState);
 *          }
 *          else if (NodeEditor.curEditorState.selectedNode == null)
 *          {
 *              Debug.Log("OnGUI::TWWindow has no Selected Node " + NodeEditor.curEditorState);
 *          }
 *          else
 *          {
 *              Debug.Log("OnGUI:: Selected Node " + NodeEditor.curEditorState.selectedNode);
 *          }
 */
            // Initiation
            NodeEditor.checkInit(true);
            if (NodeEditor.InitiationError)
            {
                GUILayout.Label("Node Editor Initiation failed! Check console for more information!");
                return;
            }
            AssureEditor();
            canvasCache.AssureCanvas();

            // Specify the Canvas rect in the EditorState
            canvasCache.editorState.canvasRect = canvasWindowRect;
            // If you want to use GetRect:
            //			Rect canvasRect = GUILayoutUtility.GetRect (600, 600);
            //			if (Event.current.type != EventType.Layout)
            //				mainEditorState.canvasRect = canvasRect;
            NodeEditorGUI.StartNodeGUI();

            // Perform drawing with error-handling
            try
            {
                if ((Event.current.keyCode >= KeyCode.A && Event.current.keyCode <= KeyCode.Z) || Event.current.keyCode == KeyCode.Escape)
                {
                    if (Event.current.keyCode == KeyCode.Escape)
                    {
                        PopupMenu.m_NameFilter = "";
                    }
                    else
                    {
                        int    ascii = ((int)Event.current.keyCode - (int)KeyCode.A) + 65;
                        string c     = Char.ConvertFromUtf32(ascii);
                        PopupMenu.m_NameFilter = c;
                    }

                    Debug.Log("m_NameFilter " + PopupMenu.m_NameFilter);
                    OverlayGUI.currentPopup = null;
                    NodeEditorInputInfo inputInfo = new NodeEditorInputInfo(canvasCache.editorState);

                    NodeEditorInputSystem.ShowContextMenu(inputInfo);
                }
                NodeEditor.DrawCanvas(canvasCache.nodeCanvas, canvasCache.editorState);


                if (canvasCache.editorState.selectedNode != null)
                {
                    if (canvasCache.editorState.selectedNode is TextureNode)
                    {
                        var tn = canvasCache.editorState.selectedNode as TextureNode;
                        if (tn.m_RequestRepaint)
                        {
                            tn.m_RequestRepaint = false;
                            Debug.Log("repaint 1");
                            Repaint();
                            m_InspectorWindow.Repaint();
                        }
                    }
                }


                if (wwwShader1 != null)
                {
                    GUI.Label(new Rect(100, 100, 500, 200), "One Time Shader Download in progress...");
                }
            }
            catch (UnityException e)
            { // on exceptions in drawing flush the canvas to avoid locking the ui.
                canvasCache.NewNodeCanvas();
                NodeEditor.ReInit(true);
                Debug.LogError("Unloaded Canvas due to an exception during the drawing phase!");
                Debug.LogException(e);
            }
            if (m_PostOnLoadCanvasFixup != null)
            {
//                m_PostOnLoadCanvasFixup.PostOnLoadCanvasFixup();
                m_PostOnLoadCanvasFixup = null;
            }


            // Draw Side Window
            //sideWindowWidth = Math.Min(600, Math.Max(200, (int)(position.width / 5)));
            //GUILayout.BeginArea(sideWindowRect, GUI.skin.box);
            //DrawSideWindow();
            //GUILayout.EndArea();


            NodeEditorGUI.EndNodeGUI();
//            if (Event.current.type == EventType.Repaint)
//                m_InspectorWindow.Repaint();

/*
 *          //if (Event.current.type == EventType.Repaint)
 *          {
 *              if (mainEditorState.selectedNode != mainEditorState.wantselectedNode)
 *              {
 *                  mainEditorState.selectedNode = mainEditorState.wantselectedNode;
 *                  NodeEditor.RepaintClients();
 *                  Repaint();
 *              }
 *
 *          }
 */

            if (!m_Docked && m_DockedRetry++ < 100 && m_InspectorWindow != null && m_NodeSelectionWindow != null)
            {
                try
                {
                    m_DockedRetry++;
                    Docker.Dock(this, m_InspectorWindow, Docker.DockPosition.Right);
                    Docker.Dock(this, m_NodeSelectionWindow, Docker.DockPosition.Left);
                }
                catch (Exception ex)
                {
                    Debug.LogError(" Dock failed " + ex);
                }
                m_Docked = true;
            }
        }
        private void OnGUI()
        {
            if (wwwShader1 != null)
            {
                if (wwwShader1.isDone)
                {
                    string pathShader = "Assets/TextureWang/Shaders/TextureOps.shader";
                    pathShader = pathShader.Replace("/", "" + Path.DirectorySeparatorChar);

                    File.WriteAllBytes(pathShader, wwwShader1.bytes);
                    AssetDatabase.ImportAsset(pathShader, ImportAssetOptions.ForceSynchronousImport);
                    wwwShader1 = null;
                }
                Repaint();
            }


            if (m_ReplaceNode != null && !OverlayGUI.HasPopupControl() && ms_InputInfo != null)
            {
                NodeEditorInputSystem.ShowContextMenu(ms_InputInfo);
                ms_InputInfo = null;
            }

/*
 *          if (NodeEditor.curEditorState == null)
 *          {
 *              Debug.Log("OnGUI::TWWindow has no editor state " + NodeEditor.curEditorState+"actual editor state "+ canvasCache.editorState);
 *          }
 *          else if (NodeEditor.curEditorState.selectedNode == null)
 *          {
 *              Debug.Log("OnGUI::TWWindow has no Selected Node " + NodeEditor.curEditorState);
 *          }
 *          else
 *          {
 *              Debug.Log("OnGUI:: Selected Node " + NodeEditor.curEditorState.selectedNode);
 *          }
 */
            // Initiation
            NodeEditor.checkInit(true);
            if (NodeEditor.InitiationError)
            {
                GUILayout.Label("Node Editor Initiation failed! Check console for more information!");
                return;
            }
            AssureEditor();
            canvasCache.AssureCanvas();

            // Specify the Canvas rect in the EditorState
            canvasCache.editorState.canvasRect = canvasWindowRect;
            // If you want to use GetRect:
            //			Rect canvasRect = GUILayoutUtility.GetRect (600, 600);
            //			if (Event.current.type != EventType.Layout)
            //				mainEditorState.canvasRect = canvasRect;
            NodeEditorGUI.StartNodeGUI();

            // Perform drawing with error-handling
            try
            {
                NodeEditor.DrawCanvas(canvasCache.nodeCanvas, canvasCache.editorState);


                if (canvasCache.editorState.selectedNode != null)
                {
                    if (canvasCache.editorState.selectedNode is TextureNode)
                    {
                        var tn = canvasCache.editorState.selectedNode as TextureNode;
                        if (tn.m_RequestRepaint)
                        {
                            tn.m_RequestRepaint = false;
                            Repaint();
                            m_InspectorWindow.Repaint();
                        }
                    }
                }
                if (wwwShader1 != null)
                {
                    GUI.Label(new Rect(100, 100, 500, 200), "One Time Shader Download in progress...");
                }
            }
            catch (UnityException e)
            { // on exceptions in drawing flush the canvas to avoid locking the ui.
                canvasCache.NewNodeCanvas();
                NodeEditor.ReInit(true);
                Debug.LogError("Unloaded Canvas due to an exception during the drawing phase!");
                Debug.LogException(e);
            }
            if (m_PostOnLoadCanvasFixup != null)
            {
//                m_PostOnLoadCanvasFixup.PostOnLoadCanvasFixup();
                m_PostOnLoadCanvasFixup = null;
            }


            // Draw Side Window
            //sideWindowWidth = Math.Min(600, Math.Max(200, (int)(position.width / 5)));
            //GUILayout.BeginArea(sideWindowRect, GUI.skin.box);
            //DrawSideWindow();
            //GUILayout.EndArea();


            NodeEditorGUI.EndNodeGUI();
//            if (Event.current.type == EventType.Repaint)
//                m_InspectorWindow.Repaint();

/*
 *          //if (Event.current.type == EventType.Repaint)
 *          {
 *              if (mainEditorState.selectedNode != mainEditorState.wantselectedNode)
 *              {
 *                  mainEditorState.selectedNode = mainEditorState.wantselectedNode;
 *                  NodeEditor.RepaintClients();
 *                  Repaint();
 *              }
 *
 *          }
 */

            if (!m_Docked && m_DockedRetry++ < 100 && m_InspectorWindow != null && m_NodeSelectionWindow != null)
            {
                try
                {
                    m_DockedRetry++;
                    Docker.Dock(this, m_InspectorWindow, Docker.DockPosition.Right);
                    Docker.Dock(this, m_NodeSelectionWindow, Docker.DockPosition.Left);
                }
                catch (Exception ex)
                {
                    Debug.LogError(" Dock failed " + ex);
                }
                m_Docked = true;
            }
        }
Пример #13
0
        private void OnGUI()
        {
            GUI.enabled = !ShowTutorial;
            NodeEditor.NoBuildShader = false;

            if (Event.current.type == EventType.MouseUp && Event.current.button == 0)
            {
                if (NodeEditor.AutoUpdate)
                {
                    NodeEditor.RecalculateFlag = true;
                }
            }

            NodeEditor.checkInit(true);
            if (NodeEditor.InitiationError)
            {
                GUILayout.Label("Shadero Sprite Shader Editor Initiation failed! Check console for more information!");
                return;
            }
            AssureEditor();
            canvasCache.AssureCanvas();

            canvasCache.editorState.canvasRect = canvasWindowRect;

            NodeEditorGUI.StartNodeGUI();

            try
            {
                NodeEditor.DrawCanvas(canvasCache.nodeCanvas, canvasCache.editorState);
            }
            catch (UnityException e)
            { canvasCache.NewNodeCanvas();
              NodeEditor.ReInit(true);
              Debug.LogError("Unloaded Canvas due to an exception during the drawing phase!");
              Debug.LogException(e); }



            if (NodeEditor.NoBuildShader)
            {
                if (!NodeEditor.FlagIsSaved)
                {
                    float x = canvasCache.editorState.panOffset.x + NodeEditor.BuildShaderPosX;
                    float y = canvasCache.editorState.panOffset.y + NodeEditor.BuildShaderPosY;

                    x /= canvasCache.editorState.zoom;
                    y /= canvasCache.editorState.zoom;
                    x -= 110;
                    y -= 20;
                    x += position.width * 0.4f;
                    y += position.height * 0.4f;
                    y += (90 / canvasCache.editorState.zoom);

                    Texture2D preview = ResourceManager.LoadTexture("Help/arrow.png");
                    GUI.DrawTexture(new Rect(x, y, 128, 100), preview);

                    bframecount += Time.fixedDeltaTime * 0.25f;
                    if (bframecount > 1)
                    {
                        bframe++; bframecount = 0;
                    }
                    if (bframe >= 16)
                    {
                        bframe = 0;
                    }


                    preview = ResourceManager.LoadTexture("Help/help_light.png");

                    x -= 420;
                    y -= 100;

                    GUI.DrawTexture(new Rect(x - 24, y - 24, 410 + 48, 363 + 48), preview);


                    if (bframe == 0)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_1.jpg");
                    }
                    if (bframe == 1)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_2.jpg");
                    }
                    if (bframe == 2)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_3.jpg");
                    }
                    if (bframe == 3)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_4.jpg");
                    }
                    if (bframe == 4)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_5.jpg");
                    }
                    if (bframe == 5)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_6.jpg");
                    }
                    if (bframe == 6)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_7.jpg");
                    }
                    if (bframe == 7)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_8.jpg");
                    }
                    if (bframe == 8)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_9.jpg");
                    }
                    if (bframe == 9)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_10.jpg");
                    }
                    if (bframe == 10)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_11.jpg");
                    }
                    if (bframe == 11)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_12.jpg");
                    }
                    if (bframe == 12)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_13.jpg");
                    }
                    if (bframe >= 13)
                    {
                        preview = ResourceManager.LoadTexture("Help/Init_build_anm_14.jpg");
                    }



                    GUI.DrawTexture(new Rect(x, y, 410, 363), preview);
                }
            }

            sideWindowWidth = Math.Min(205, Math.Max(205, (int)(position.width / 5)));
            GUILayout.BeginArea(sideWindowRect, GUI.skin.box);
            DrawSideWindow();
            GUILayout.EndArea();



            if (GUI.Button(new Rect(10, 75, 200, 20), new GUIContent("Help Tutorial")))
            {
                ShowTutorial = !ShowTutorial;
            }

            if (ShowTutorial)
            {
                GUI.enabled = ShowTutorial;
                Texture2D preview = ResourceManager.LoadTexture("Help/tut_back.png");
                float     x       = position.width;
                float     y       = position.height;
                float     sx      = 926;
                float     sy      = 490;
                Rect      r       = new Rect(x / 2 - sx / 2, y / 2 - sy / 2, sx, sy);
                GUI.DrawTexture(r, preview);
                float Bsize   = 127;
                float Bpos    = 60;
                float Bheight = 35;
                if (GUI.Button(new Rect((x / 2 - sx / 2) + 22, (y / 2 + sy / 2) - Bpos, Bsize - 5, Bheight), new GUIContent("1. Basic part 1")))
                {
                    ShowTutorialCurrent = 0;
                }
                if (GUI.Button(new Rect((x / 2 - sx / 2) + 22 + Bsize, (y / 2 + sy / 2) - Bpos, Bsize - 5, Bheight), new GUIContent("2. Basic part 2")))
                {
                    ShowTutorialCurrent = 1;
                }
                if (GUI.Button(new Rect((x / 2 - sx / 2) + 22 + Bsize * 2, (y / 2 + sy / 2) - Bpos, Bsize - 5, Bheight), new GUIContent("3. The UV")))
                {
                    ShowTutorialCurrent = 2;
                }
                if (GUI.Button(new Rect((x / 2 - sx / 2) + 22 + Bsize * 3, (y / 2 + sy / 2) - Bpos, Bsize - 5, Bheight), new GUIContent("4. Use Shader")))
                {
                    ShowTutorialCurrent = 3;
                }
                if (GUI.Button(new Rect((x / 2 - sx / 2) + 22 + Bsize * 4, (y / 2 + sy / 2) - Bpos, Bsize - 5, Bheight), new GUIContent("5. Parameters")))
                {
                    ShowTutorialCurrent = 4;
                }
                if (GUI.Button(new Rect((x / 2 - sx / 2) + 22 + Bsize * 5, (y / 2 + sy / 2) - Bpos, Bsize - 5, Bheight), new GUIContent("6. HDR")))
                {
                    ShowTutorialCurrent = 5;
                }
                if (GUI.Button(new Rect((x / 2 - sx / 2) + 22 + Bsize * 6, (y / 2 + sy / 2) - Bpos, Bsize - 5, Bheight), new GUIContent("OK")))
                {
                    ShowTutorial = !ShowTutorial;
                }
                if (GUI.Button(new Rect(10, 75, 200, 20), new GUIContent("Help Tutorial")))
                {
                    ShowTutorial = !ShowTutorial;
                }

                if (ShowTutorialCurrent == 0)
                {
                    preview = ResourceManager.LoadTexture("Help/tut_img1.jpg");
                }
                if (ShowTutorialCurrent == 1)
                {
                    preview = ResourceManager.LoadTexture("Help/tut_img2.jpg");
                }
                if (ShowTutorialCurrent == 2)
                {
                    preview = ResourceManager.LoadTexture("Help/tut_img3.jpg");
                }
                if (ShowTutorialCurrent == 3)
                {
                    preview = ResourceManager.LoadTexture("Help/tut_img4.jpg");
                }
                if (ShowTutorialCurrent == 4)
                {
                    preview = ResourceManager.LoadTexture("Help/tut_img5.jpg");
                }
                if (ShowTutorialCurrent == 5)
                {
                    preview = ResourceManager.LoadTexture("Help/tut_img6.jpg");
                }
                r.x     += 23;
                r.y     += 53;
                r.width  = 875;
                r.height = 372;
                GUI.DrawTexture(r, preview);
            }

            NodeEditorGUI.EndNodeGUI();
            NodeEditor.NoBuildShaderContext = NodeEditor.NoBuildShader;
        }