示例#1
0
        ////////////////////////////////////////////////////////////////////////
        /// Func

        /// <summary>
        /// <para>Eng. Inspector for edit Scene Background Image, BGM</para>
        /// <para>Kor. 씬의 배경 이미지, 배경음을 설정하는 인스펙터입니다. </para>
        /// </summary>
        /// <param name="_vinove"> <para> Eng. Parent Vinove class of Scene Class</para>
        ///                         <para> Kor. 씬 클래스를 지닌 Vinove 클래스입니다. </para> </param>
        /// <param name="_scene"> <para> Eng. IMG, BGM change target Scene class.</para>
        ///                         <para> Kor. 이미지, 배경음을 변경할 씬 클래스입니다. </para> </param>
        public SceneBackgroundInspector(Vinove _vinove, VinoveScene _scene)
        {
            _currentVinove = _vinove;
            _currentScene  = _scene;

            _backgroundIllustItems = new string[_currentVinove.SpeakerIllustrations.Count];
        }
示例#2
0
        public void NewGameInitialize()
        {
            _gameState = GameState.InGame;
            _uiState   = InGameInterfaceDisplayState.Dialogue;

            // ----------------------- Vinove - Starter Scene -----------------------

            if (ErrorDetector.Instance.IsStringHasData(_currentVinove.StarterUID))
            {
                // ----------------------- Scene -----------------------
                _currentScene = _currentVinove.FindSceneWithUID(_currentVinove.StarterUID);

                // ----------------------- Scene - Starter Script -----------------------
                if (ErrorDetector.Instance.IsStringHasData(_currentScene.StarterUID))
                {
                    _currentScript = _currentScene.FindScriptWithUID(_currentScene.StarterUID);
                }
            }

            _speakerLeftIllustration.GetComponent <SpeakerIllustrationPosition>().SetDeactivated();
            _speakerCenterIllustration.GetComponent <SpeakerIllustrationPosition>().SetDeactivated();
            _speakerRightIllustration.GetComponent <SpeakerIllustrationPosition>().SetDeactivated();

            SyncInterface();
        }
示例#3
0
        /// <summary>
        /// <para>Eng. Load game using script uid. </para>
        /// <para>Kor. 스크립트 UID 등의 정보로, 게임을 불러옵니다. </para>
        /// </summary>
        public void LoadGameByScript(VinoveGameSaveData _savedData)
        {
            _currentScene  = _currentVinove.FindSceneWithUID(_savedData._parentSceneUID);
            _currentScript = _currentScene.FindScriptWithUID(_savedData._scriptUID);

            // ----------------------- Scene - Background Img -----------------------
            Texture2D _sceneBackgroundIllust;

            if (_currentVinove.BackgroundIllustrations.GetTextureData(_currentScene.BackgroundIllustKey, out _sceneBackgroundIllust))
            {
                Rect _backgroundTexRect = new Rect(0, 0, _sceneBackgroundIllust.width, _sceneBackgroundIllust.height);
                _backgroundIllustration.sprite = Sprite.Create(_sceneBackgroundIllust, _backgroundTexRect, new Vector2(0.5f, 0.5f));
            }

            // ----------------------- Scene - Background Music -----------------------
            if (_currentScene.BackgroundMusic != null)
            {
                _sceneBGM.clip = _currentScene.BackgroundMusic;

                _sceneBGM.Play();
            }

            // ----------------------- Script - Speaker Illustrations & Color -----------------------

            Texture2D _speakerIllust;

            if (_currentVinove.SpeakerIllustrations.GetTextureData(_savedData._speakerIllustKey[0], out _speakerIllust))
            {
                SetSpeakerIllustImageFromTexture(_speakerLeftIllustration, _speakerIllust);

                Color _illustColor = _speakerLeftIllustration.color;
                _speakerLeftIllustration.color = new Color(_illustColor.r, _illustColor.g, _illustColor.b, _savedData._speakerIllustColorAlpha[0]);
                _speakerLeftIllustration.GetComponent <SpeakerIllustrationPosition>().IsActivated = _savedData._speakerIllustActivated[0];
                _speakerLeftIllustration.GetComponent <SpeakerIllustrationPosition>().ColorUncurrentSpeaker();
            }

            if (_currentVinove.SpeakerIllustrations.GetTextureData(_savedData._speakerIllustKey[1], out _speakerIllust))
            {
                SetSpeakerIllustImageFromTexture(_speakerCenterIllustration, _speakerIllust);

                Color _illustColor = _speakerCenterIllustration.color;
                _speakerCenterIllustration.color = new Color(_illustColor.r, _illustColor.g, _illustColor.b, _savedData._speakerIllustColorAlpha[1]);
                _speakerCenterIllustration.GetComponent <SpeakerIllustrationPosition>().IsActivated = _savedData._speakerIllustActivated[1];
                _speakerCenterIllustration.GetComponent <SpeakerIllustrationPosition>().ColorUncurrentSpeaker();
            }

            if (_currentVinove.SpeakerIllustrations.GetTextureData(_savedData._speakerIllustKey[2], out _speakerIllust))
            {
                SetSpeakerIllustImageFromTexture(_speakerRightIllustration, _speakerIllust);

                Color _illustColor = _speakerRightIllustration.color;
                _speakerRightIllustration.color = new Color(_illustColor.r, _illustColor.g, _illustColor.b, _savedData._speakerIllustColorAlpha[2]);
                _speakerRightIllustration.GetComponent <SpeakerIllustrationPosition>().IsActivated = _savedData._speakerIllustActivated[2];
                _speakerRightIllustration.GetComponent <SpeakerIllustrationPosition>().ColorUncurrentSpeaker();
            }

            // ----------------------- Script -----------------------
            SyncScript();
        }
示例#4
0
        // -------------------- Undo - Move --------------------

        /// <summary>
        /// <para>Eng. Push 'Move' into Undo Stack </para>
        /// <para>Kor. Undo 스택에 '이동' 스택을 넣습니다. </para>
        /// </summary>
        /// <param name="_targetUID">
        /// <para>Eng. Target Graph UID </para>
        /// <para>Kor. 대상 그래프의 UID 입니다. </para></param>
        /// <param name="_scene">
        /// <para>Eng. Target Graph Data </para>
        /// <para>Kor. 대상 그래프 데이터입니다. </para></param>
        public static void UndoStackMove(string _targetUID, VinoveScene _scene)
        {
            UndoRedoStackData _stackData = new UndoRedoStackData(UndoRedoWorkType.GraphMove, GraphType.Scene, _targetUID);

            _stackData.SetGraphData(_scene);

            AddUndoData(_stackData);
        }
        static void OpenSceneBackgroundInspector(VinoveScene _targetScene)
        {
            SceneBackgroundInspector _BgInspector = new SceneBackgroundInspector(currentVinove, _targetScene);

            Vector2 _inspectorSize = _BgInspector.GetWindowSize();
            Rect    _activeRect    = new Rect(e.mousePosition.x, e.mousePosition.y, 0, 0);

            PopupWindow.Show(_activeRect, _BgInspector);
        }
示例#6
0
        /// <summary>
        /// <para>Eng. Inspector for Script Graph rename</para>
        /// <para>Kor. 스크립트 그래프의 이름을 변경하는 인스펙터입니다. </para>
        /// </summary>
        /// <param name="_vinove"> <para> Eng. Parent vinove class of graph</para>
        ///                         <para> Kor. 해당 그래프를 지니고 있는 Vinove 클래스 입니다. </para> </param>
        /// <param name="_scene"> <para> Eng. parent scene class of Scrip</para>
        ///                         <para> Kor. 이름 변경 대상 스크립트를 지닌 씬 클래스 입니다. </para> </param>
        /// <param name="_uid"> <para> Eng. UID of rename target Graph</para>
        ///                         <para> Kor. 이름을 변경할 대상 그래프의 UID 입니다 </para> </param>
        public RenameInspector(Vinove _vinove, VinoveScene _scene, string _uid)
        {
            _currentVinove = _vinove;
            _sourceUID     = _uid;

            if (_sourceUID.StartsWith("SCR"))
            {
                _script = _scene.FindScriptWithUID(_uid);
            }
        }
示例#7
0
        /// <summary>
        /// <para>Eng. Assign Vinove file on Canvas UI GameObject. </para>
        /// <para>Kor. 비노비 파일을 인게임 매니저 오브젝트에 등록합니다. </para>
        /// </summary>
        public void VinoveInitialize()
        {
#if UNITY_EDITOR
            string _archivePath = Application.dataPath + "/TemporaryArchive.vnvach";

            if (System.IO.File.Exists(_archivePath))
            {
                var loaded = Resources.Load <Vinove>("Gamedat");
                AssetPathArchive _archive = BinaryIOManager.GetInst().BinaryDeserialize <AssetPathArchive>(_archivePath);

                AssetDatabase.ImportAsset(_archive._path);
                var currentLoaded = AssetDatabase.LoadAssetAtPath <Vinove>(_archive._path);
                _currentVinove = currentLoaded as Vinove;
                // ----------------------- Vinove - Starter Scene -----------------------

                if (ErrorDetector.Instance.IsStringHasData(_archive._sceneUID))
                {
                    // ----------------------- Scene -----------------------
                    _currentScene = _currentVinove.FindSceneWithUID(_archive._sceneUID);

                    // ----------------------- Scene - Specific Script -----------------------

                    if (ErrorDetector.Instance.IsStringHasData(_archive._scriptUID))
                    {
                        _currentScript = _currentScene.FindScriptWithUID(_archive._scriptUID);
                    }
                    // ----------------------- Scene - Starter Script -----------------------
                    else if (ErrorDetector.Instance.IsStringHasData(_currentScene.StarterUID))
                    {
                        _currentScript = _currentScene.FindScriptWithUID(_currentScene.StarterUID);
                    }
                }
            }
#else
            if (_currentVinove == null)
            {
                _currentVinove = Resources.Load <Vinove>("Gamedat");

                // ----------------------- Vinove - Starter Scene -----------------------

                if (ErrorDetector.Instance.IsStringHasData(_currentVinove.StarterUID))
                {
                    // ----------------------- Scene -----------------------
                    _currentScene = _currentVinove.FindSceneWithUID(_currentVinove.StarterUID);

                    // ----------------------- Scene - Specific Script -----------------------

                    if (ErrorDetector.Instance.IsStringHasData(_currentScene.StarterUID))
                    {
                        _currentScript = _currentScene.FindScriptWithUID(_currentScene.StarterUID);
                    }
                }
            }
#endif
        }
示例#8
0
        ////////////////////////////////////////////////////////////////////////
        /// Func

        /// <summary>
        /// <para>Eng. Inspector for Scene, Branch, Merge Graph rename</para>
        /// <para>Kor. 씬, 분기, 병합 그래프의 이름을 변경하는 인스펙터입니다. </para>
        /// </summary>
        /// <param name="_vinove"> <para> Eng. Parent vinove class of graph</para>
        ///                         <para> Kor. 해당 그래프를 지니고 있는 Vinove 클래스 입니다. </para> </param>
        /// <param name="_uid"> <para> Eng. UID of rename target Graph</para>
        ///                         <para> Kor. 이름을 변경할 대상 그래프의 UID 입니다 </para> </param>
        public RenameInspector(Vinove _vinove, string _uid)
        {
            _currentVinove = _vinove;
            _sourceUID     = _uid;

            if (_sourceUID.StartsWith("BRA"))
            {
                _branch = _currentVinove.FindBranchWithUID(_sourceUID);
            }
            else if (_sourceUID.StartsWith("MRG"))
            {
                _merge = _currentVinove.FindMergeWithUID(_sourceUID);
            }
            else if (_sourceUID.StartsWith("SCE"))
            {
                _scene = _currentVinove.FindSceneWithUID(_sourceUID);
            }
        }
示例#9
0
        ////////////////////////////////////////////////////////////////////////
        /// Func

        /// <summary>
        /// <para>Eng. GraphViewer Event Proc Func </para>
        /// <para>Kor. GraphViewer의 이벤트를 담당하는 함수 </para>
        /// </summary>
        /// <param name="_vinove"> <para> Eng. Currently opened vinove file</para>
        ///                           <para> Kor. 현재 열린 비노비 파일 </para> </param>
        /// <param name="_canvasMousePos"> <para> Eng. Mouse pos on Canvas</para>
        ///                           <para> Kor. 캔버스 내에서의 마우스 위치</para> </param>
        static void GraphEvents(Vinove _vinove, Vector2 _canvasMousePos)
        {
            if (IsMouseOnMinimap())
            {
            }
            else
            {
                if (e.type == EventType.Repaint)
                {
                    needRepaint = false;
                }

                if (e.type == EventType.MouseUp)
                {
                    graphTranslating = false;

                    hoverScene  = null;
                    hoverBranch = null;
                    hoverMerge  = null;
                }

                if (e.type == EventType.MouseMove)
                {
                    hoverScene = currentVinove.IsContainWholeGraph(e.mousePosition);
                    if (hoverScene == null)
                    {
                        hoverBranch = currentVinove.IsContainWholeBranch(e.mousePosition);
                        if (hoverBranch == null)
                        {
                            hoverMerge = currentVinove.IsContainWholeMerge(e.mousePosition);
                        }
                    }

                    needRepaint = true;
                }

                if (e.type == EventType.ScrollWheel)
                {   // Zoom
                    if (canvasRect.Contains(e.mousePosition))
                    {
                        float zoomCtrl  = e.control ? 0.1f : 0.2f;
                        float zoomValue = e.delta.y > 0 ? -zoomCtrl : zoomCtrl;

                        ZoomWithFocus(e.mousePosition, zoomValue);
                        e.Use();
                    }
                }

                if (((e.alt && e.button == 0 && e.type == EventType.MouseDrag && e.isMouse)) ||
                    (e.button == 2 && e.type == EventType.MouseDrag && canvasRect.Contains(e.mousePosition)))
                {   //translation canvas
                    Translation += e.delta;

                    e.Use();
                }

                if (e.type == EventType.MouseDown && e.button == 1 && canvasRect.Contains(e.mousePosition))
                {   // Open node popupMenu
                    GenericMenu popupMenu = new GenericMenu();

                    VinoveScene  overScene  = currentVinove.IsContainWholeGraph(e.mousePosition);
                    VinoveBranch overBranch = currentVinove.IsContainWholeBranch(e.mousePosition);
                    VinoveMerge  overMerge  = currentVinove.IsContainWholeMerge(e.mousePosition);

                    if (overScene == null && overBranch == null && overMerge == null)
                    {   // if, right click not on scene node
                        popupMenu.AddItem(new GUIContent("Add Scene"), false, () =>
                        {
                            currentVinove.CreateScene("New Scene", new Rect(_canvasMousePos.x, _canvasMousePos.y, 200, 100));
                            Debug.Log("popupMenu_AddScene Test");
                        });

                        popupMenu.AddItem(new GUIContent("Add Branch"), false, () =>
                        {
                            currentVinove.CreateBranch("New Branch", new Rect(_canvasMousePos.x, _canvasMousePos.y, 150, 200));
                            Debug.Log("popupMenu_AddBranch Test");
                        });

                        popupMenu.AddItem(new GUIContent("Add Merge"), false, () =>
                        {
                            currentVinove.CreateMerge("New Merge", new Rect(_canvasMousePos.x, _canvasMousePos.y, 150, 200));
                            Debug.Log("popupMenu_AddMerge Test");
                        });

                        popupMenu.AddSeparator("");

                        if (_copiedScene == null)
                        {
                            popupMenu.AddDisabledItem(new GUIContent("Paste Scene"));
                        }
                        else
                        {
                            popupMenu.AddItem(new GUIContent("Paste Scene"), false, () =>
                            {
                                currentVinove.PasteScene(_copiedScene, new Rect(_canvasMousePos.x, _canvasMousePos.y, 200, 100));
                                _copiedScene = null;
                            });
                        }

                        popupMenu.AddSeparator("");
                    }
                    else if (overScene != null)
                    {   // on graph
                        popupMenu.AddItem(new GUIContent("Open Scene"), false, () =>
                        {
                            currentScene = overScene;
                            scriptViewer = true;

                            _copiedScene = null;
                        });

                        popupMenu.AddItem(new GUIContent("Copy Scene"), false, () =>
                        {
                            _copiedScene = overScene;
                        });

                        popupMenu.AddItem(new GUIContent("Delete Scene"), false, () =>
                        {
                            GraphDeleteSequence(overScene.UID, true);
                        });

                        popupMenu.AddSeparator("");

                        popupMenu.AddItem(new GUIContent("Select Starter"), false, () =>
                        {
                            currentVinove.StarterUID = overScene.UID;
                        });

                        popupMenu.AddItem(new GUIContent("Set Background Image and Music"), false, () =>
                        {
                            OpenSceneBackgroundInspector(overScene);
                        });

                        popupMenu.AddSeparator("");

                        popupMenu.AddItem(new GUIContent("Rename"), false, () =>
                        {
                            OpenRenameInspector(overScene.UID);
                        });

                        popupMenu.AddItem(new GUIContent("Run"), false, () =>
                        {
                            AssetPathArchive _archive = new AssetPathArchive(currentVinovePath, overScene.UID);
                            string _archivePath       = "Assets/TemporaryArchive.vnvach";

                            BinaryIOManager.GetInst().BinarySerialize <AssetPathArchive>(_archive, _archivePath);

                            ToolbarFuncSave();

                            EditorApplication.isPlaying = true;
                        });
                    }
                    else if (overBranch != null)
                    {
                        popupMenu.AddItem(new GUIContent("Open Branch"), false, () =>
                        {
                            OpenBranchInspector(overBranch);
                            Debug.Log("popupMenu_OpenBranch Test : " + overBranch.UID);
                        });

                        popupMenu.AddItem(new GUIContent("Delete Branch"), false, () =>
                        {
                            GraphDeleteSequence(overBranch.UID, true);
                            Debug.Log("popupMenu_DeleteBranch");
                        });

                        popupMenu.AddSeparator("");

                        popupMenu.AddItem(new GUIContent("Change Branch Count"), false, () =>
                        {
                            OpenCountInspector(overBranch);
                        });

                        popupMenu.AddSeparator("");

                        popupMenu.AddItem(new GUIContent("Rename"), false, () =>
                        {
                            OpenRenameInspector(overBranch.UID);
                        });
                    }
                    else if (overMerge != null)
                    {
                        popupMenu.AddItem(new GUIContent("Change Merge Count"), false, () =>
                        {
                            OpenCountInspector(overMerge);
                        });

                        popupMenu.AddSeparator("");

                        popupMenu.AddItem(new GUIContent("Delete Merge"), false, () =>
                        {
                            GraphDeleteSequence(overMerge.UID, true);
                            Debug.Log("popupMenu_DeleteBranch");
                        });

                        popupMenu.AddSeparator("");

                        popupMenu.AddItem(new GUIContent("Rename"), false, () =>
                        {
                            OpenRenameInspector(overMerge.UID);
                        });
                    }

                    popupMenu.ShowAsContext();
                }

                if (e.type == EventType.MouseDrag && e.button == 0 && canvasRect.Contains(e.mousePosition) && graphTranslating == true)
                {
                    if (hoverScene != null)
                    {
                        graphTranslating = true;

                        hoverScene.MoveSceneGraph(e.delta, ZoomFactor);
                        needRepaint = true;
                    }
                    else if (hoverBranch != null)
                    {
                        graphTranslating = true;

                        hoverBranch.MoveBranchGraph(e.delta, ZoomFactor);
                        needRepaint = true;
                    }
                    else if (hoverMerge != null)
                    {
                        graphTranslating = true;

                        hoverMerge.MoveMergeGraph(e.delta, ZoomFactor);
                        needRepaint = true;
                    }

                    e.Use();
                }


                if (e.isMouse && e.type == EventType.MouseDown && e.clickCount == 2)
                {   // Double clicked
                    graphTranslating = false;

                    VinoveScene overScene = currentVinove.IsContainWholeGraph(e.mousePosition);

                    if (overScene != null)
                    {
                        currentScene            = overScene;
                        scriptViewer            = true;
                        prevLinkUID             = null;
                        linkerControllActivated = false;

                        _copiedScene = null;

                        _undoList.Clear();
                    }

                    VinoveBranch overBranch = currentVinove.IsContainWholeBranch(e.mousePosition);

                    if (overBranch != null)
                    {
                        OpenBranchInspector(overBranch);
                    }
                    e.Use();
                }

                if (e.type == EventType.MouseDown && e.button == 0)
                {
                    if (hoverScene == null && hoverBranch == null && hoverMerge == null)
                    {
                        linkerControllActivated = false;
                    }
                    else
                    {
                        graphTranslating = true;
                    }
                }
            }
        }
示例#10
0
        /// <summary>
        /// <para>Eng. Script GraphViewer Event Proc Func </para>
        /// <para>Kor. Script GraphViewer의 이벤트를 담당하는 함수 </para>
        /// </summary>
        /// <param name="_vinove"> <para> Eng. Currently opened vinove file</para>
        ///                           <para> Kor. 현재 열린 비노비 파일 </para> </param>
        /// <param name="_openedScene"> <para> Eng. Currently opened scene</para>
        ///                           <para> Kor. 현재 뷰어로 열린 씬</para> </param>
        /// <param name="_canvasMousePos"> <para> Eng. Mouse pos in Canvas</para>
        ///                           <para> Kor. 캔버스 내에서의 마우스 위치</para> </param>
        static void ScriptGraphEvents(Vinove _vinove, VinoveScene _openedScene, Vector2 _canvasMousePos)
        {
            if (IsMouseOnMinimap())
            {
            }
            else
            {
                if (e.type == EventType.Repaint)
                {
                    needRepaint = false;
                }

                if (e.type == EventType.MouseUp)
                {
                    graphTranslating = false;
                    hoverScript      = null;
                }

                if (e.type == EventType.ScrollWheel)
                {   // Zoom
                    if (canvasRect.Contains(e.mousePosition))
                    {
                        float zoomCtrl  = e.control ? 0.1f : 0.2f;
                        float zoomValue = e.delta.y > 0 ? -zoomCtrl : zoomCtrl;

                        ZoomWithFocus(e.mousePosition, zoomValue);
                        e.Use();
                    }
                }

                if (((e.alt && e.button == 0 && e.type == EventType.MouseDrag && e.isMouse)) ||
                    (e.button == 2 && e.type == EventType.MouseDrag && canvasRect.Contains(e.mousePosition)))
                {   //translation canvas
                    _openedScene.Translation += e.delta;

                    e.Use();
                }

                if (e.type == EventType.MouseDown && e.button == 1 && canvasRect.Contains(e.mousePosition))
                {   // Open node popupMenu
                    GenericMenu popupMenu = new GenericMenu();

                    VinoveScript overScript = _openedScene.IsContainWholeGraph(e.mousePosition);
                    if (overScript == null)
                    {   // if, right click not on scene node
                        popupMenu.AddItem(new GUIContent("Add Script"), false, () =>
                        {
                            currentVinove.CreateScript(_openedScene, "New Script", new Rect(_canvasMousePos.x, _canvasMousePos.y, Constants.HORIZONTAL_GRAPH_SIZE_X, Constants.HORIZONTAL_GRAPH_SIZE_Y));
                            Debug.Log("popupMenu_AddScript Test");
                        });
                        popupMenu.AddSeparator("");

                        if (_copiedScript == null)
                        {
                            popupMenu.AddDisabledItem(new GUIContent("Paste Script"));
                        }
                        else
                        {
                            popupMenu.AddItem(new GUIContent("Paste Script"), false, () =>
                            {
                                currentVinove.PasteScript(currentScene, _copiedScript, new Rect(_canvasMousePos.x, _canvasMousePos.y, Constants.HORIZONTAL_GRAPH_SIZE_X, Constants.HORIZONTAL_GRAPH_SIZE_Y));
                                _copiedScript = null;
                            });
                        }
                        popupMenu.AddSeparator("");
                    }
                    else
                    {   // on graph
                        popupMenu.AddItem(new GUIContent("Open Script"), false, () =>
                        {
                            OpenScriptInspector(overScript);
                            Debug.Log("popupMenu_OpenScript Test : " + overScript.UID);
                        });

                        popupMenu.AddItem(new GUIContent("Copy Script"), false, () =>
                        {
                            _copiedScript = overScript;
                        });

                        popupMenu.AddItem(new GUIContent("Delete Script"), false, () =>
                        {
                            GraphDeleteSequence(overScript.UID, true);
                            Debug.Log("popupMenu_DeleteScript Test");
                        });

                        popupMenu.AddSeparator("");

                        popupMenu.AddItem(new GUIContent("Select Starter"), false, () =>
                        {
                            currentScene.StarterUID = overScript.UID;
                        });

                        popupMenu.AddSeparator("");

                        popupMenu.AddItem(new GUIContent("Rename"), false, () =>
                        {
                            OpenRenameInspector(overScript.ParentSceneUID, overScript.UID);
                        });

                        popupMenu.AddItem(new GUIContent("Run"), false, () =>
                        {
                            ToolbarFuncSave();

                            AssetPathArchive _archive = new AssetPathArchive(currentVinovePath, overScript.ParentSceneUID, overScript.UID);
                            string _archivePath       = "Assets/TemporaryArchive.vnvach";

                            BinaryIOManager.GetInst().BinarySerialize <AssetPathArchive>(_archive, _archivePath);

                            EditorApplication.isPlaying = true;
                        });
                    }

                    popupMenu.ShowAsContext();
                }

                if (e.type == EventType.MouseDrag && e.button == 0 && canvasRect.Contains(e.mousePosition))
                {   // Graph Translating
                    VinoveScript overScript = currentScene.IsContainWholeGraph(e.mousePosition);

                    if (hoverScript != null)
                    {
                        graphTranslating = true;

                        hoverScript.MoveScriptGraph((e.delta / currentScene.ZoomFactor));
                        needRepaint = true;
                    }

                    e.Use();
                }

                if (e.isMouse && e.type == EventType.MouseDown && e.clickCount == 2)
                {   // Double clicked
                    graphTranslating = false;

                    VinoveScript overScript = currentScene.IsContainWholeGraph(e.mousePosition);

                    if (overScript != null)
                    {
                        OpenScriptInspector(overScript);
                    }
                    e.Use();
                }

                if (e.type == EventType.MouseDown && e.button == 0)
                {
                    VinoveScript _scriptTmp = currentScene.IsContainWholeGraph(e.mousePosition);

                    if (_scriptTmp == null)
                    {
                        linkerControllActivated = false;
                    }
                    else if (graphTranslating == false)
                    {
                        hoverScript = _scriptTmp;
                    }
                }
            }
        }
示例#11
0
 public void SetGraphData(VinoveScene _scene)
 {
     _targetScene = _scene;
 }