Ejemplo n.º 1
0
        /// <summary>
        /// <para>Eng. Create scene with copied scene. </para>
        /// <para>Kor. 씬 그래프를 복사해서 새로운 씬을 생성합니다. </para>
        /// </summary>
        /// <param name="_copiedScene"> <para> Eng. Origin copied graph </para>
        ///                           <para> Kor. 복사할 씬 그래프. </para> </param>
        public void PasteScene(VinoveScene _copiedScene, Rect _position)
        {
            VinoveScene CreatedScene = new VinoveScene(_copiedScene, _position);

            _uids.Add(CreatedScene.UID);
            _scenes.Add(CreatedScene);

            if (ErrorDetector.Instance.IsStringEmpty(StarterUID))
            {
                StarterUID = CreatedScene.UID;
            }

            for (int i = 0; i < _copiedScene.Scripts.Count; i++)
            {
                CreateScript(CreatedScene, _copiedScene.Scripts[i]);
            }

            foreach (VinoveScript _script in CreatedScene.Scripts)
            {
                string _instancedUID = UIDGenerator.Instance.Generate("SCR");
                if (_copiedScene.StarterUID == _script.UID)
                {
                    CreatedScene.StarterUID = _instancedUID;
                }

                if (ErrorDetector.Instance.IsStringHasData(_script.Next))
                {   // it has next link
                    VinoveScript _nextScript = CreatedScene.FindScriptWithUID(_script.Next);

                    if (!ErrorDetector.Instance.IsStringHasData(_script.Prev))
                    {   // it has prev link, already had new uid
                        _script.UID = _instancedUID;
                        _uids.Add(_instancedUID);
                    }

                    if (_copiedScene.StarterUID == _nextScript.UID)
                    {
                        _nextScript.UID         = UIDGenerator.Instance.Generate("SCR");
                        CreatedScene.StarterUID = _nextScript.UID;
                        _uids.Add(_nextScript.UID);
                    }
                    else
                    {
                        _nextScript.UID = UIDGenerator.Instance.Generate("SCR");
                        _uids.Add(_nextScript.UID);
                    }

                    _script.Next     = _nextScript.UID;
                    _nextScript.Prev = _script.UID;
                }
                else
                {     // non-next link
                    if (!ErrorDetector.Instance.IsStringHasData(_script.Prev))
                    { // it has prev link, already had new uid
                        _script.UID = _instancedUID;
                        _uids.Add(_instancedUID);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// <para>Eng. Create script class with Copy/Paste(Only for Scene Copy). Manage one dialogue </para>
        /// <para>Kor. 복사/붙여넣기로 스크립트 클래스를 생성합니다(씬 복사 전용). 한 개의 대사를 담당합니다. </para>
        /// </summary>
        /// <param name="_scene"> <para> Eng. Scene for add script</para>
        ///                           <para> Kor. 스크립트를 추가 대상인 씬입니다.</para> </param>
        /// <param name="_originScript"> <para> Eng. Origin script data </para>
        ///                           <para> Kor. 기존 스크립트 정보입니다.</para> </param>
        public void CreateScript(VinoveScene _scene, VinoveScript _originScript)
        {
            //Debug.Log("Created Script Graph in : " + _originScript.Position);
            VinoveScript CreatedScript = new VinoveScript(_originScript, _scene.UID, _originScript.Prev, _originScript.Next);

            //_uids.Add(CreatedScript.UID);
            _scene.Scripts.Add(CreatedScript);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// <para>Eng. Create script class. Manage one conversation </para>
        /// <para>Kor. 스크립트 클래스를 생성합니다. 한 개의 대사를 담당합니다. </para>
        /// </summary>
        /// <param name="_originScript"> <para> Eng. Original script data </para>
        ///                           <para> Kor. 기존 스크립트 정보입니다.</para> </param>
        /// <param name="_parentUID"> <para> Eng. Created Script parent uid </para>
        ///                           <para> Kor. 생성할 스크립트를 지닌 씬 클래스의 UID 입니다. </para> </param>
        public VinoveScript(VinoveScript _originScript, string _parentUID, Rect _position)
        {
            _scriptName     = _originScript.Name;
            _rectSize       = _position;
            _UID            = UIDGenerator.Instance.Generate("SCR");
            _parentSceneUID = _parentUID;

            _conversation = new Conversation(_originScript.ScriptConversation);

            SyncLinkerPosition();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// <para>Eng. Create script class with Copy/Paste. Manage one dialogue </para>
        /// <para>Kor. 복사/붙여넣기로 스크립트 클래스를 생성합니다. 한 개의 대사를 담당합니다. </para>
        /// </summary>
        /// <param name="_scene"> <para> Eng. Scene for add script</para>
        ///                           <para> Kor. 스크립트를 추가 대상인 씬입니다.</para> </param>
        /// <param name="_originScript"> <para> Eng. Origin script data </para>
        ///                           <para> Kor. 기존 스크립트 정보입니다.</para> </param>
        /// <param name="_position"> <para> Eng. Rect for Pos and Scale on graph </para>
        ///                           <para> Kor. 그래프상의 위치, 크기 용 Rect 입니다</para> </param>
        public void PasteScript(VinoveScene _scene, VinoveScript _originScript, Rect _position)
        {
            Debug.Log("Pasted Script Graph in : " + _position);
            VinoveScript CreatedScript = new VinoveScript(_originScript, _scene.UID, _position);

            _uids.Add(CreatedScript.UID);
            _scene.Scripts.Add(CreatedScript);

            if (ErrorDetector.Instance.IsStringEmpty(_scene.StarterUID))
            {
                _scene.StarterUID = CreatedScript.UID;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// <para>Eng. Create script class. Manage one conversation </para>
        /// <para>Kor. 스크립트 클래스를 생성합니다. 한 개의 대사를 담당합니다. </para>
        /// </summary>
        /// <param name="_originScript"> <para> Eng. Original script data </para>
        ///                           <para> Kor. 기존 스크립트 정보입니다.</para> </param>
        /// <param name="_parentUID"> <para> Eng. Created Script parent uid </para>
        ///                           <para> Kor. 생성할 스크립트를 지닌 씬 클래스의 UID 입니다. </para> </param>
        /// <param name="_prevLink"> <para> Eng. Prev link of original script data </para>
        ///                           <para> Kor. 기존 데이터가 가지던 이전 링크입니다 </para> </param>
        /// <param name="_nextLink"> <para> Eng. Next link of original script data </para>
        ///                           <para> Kor. 기존 데이터가 가지던 다음 링크입니다. </para> </param>
        public VinoveScript(VinoveScript _originScript, string _parentUID, string _prevLink, string _nextLink)
        {
            _scriptName     = _originScript.Name;
            _rectSize       = _originScript.Position;
            _UID            = _originScript.UID;
            _parentSceneUID = _parentUID;

            _prevGraphUID = _prevLink;
            _nextGraphUID = _nextLink;

            _conversation = new Conversation(_originScript.ScriptConversation);
            SyncLinkerPosition();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// <para>Eng. Create script class. Manage one dialogue </para>
        /// <para>Kor. 스크립트 클래스를 생성합니다. 한 개의 대사를 담당합니다. </para>
        /// </summary>
        /// <param name="_scene"> <para> Eng. Scene for add script</para>
        ///                           <para> Kor. 스크립트를 추가 대상인 씬입니다.</para> </param>
        /// <param name="_name"> <para> Eng. Name display on graph </para>
        ///                           <para> Kor. 그래프 상 표시될 이름입니다.</para> </param>
        /// <param name="_position"> <para> Eng. Rect for Pos and Scale on graph </para>
        ///                           <para> Kor. 그래프상의 위치, 크기 용 Rect 입니다</para> </param>
        public void CreateScript(VinoveScene _scene, string _name, Rect _position)
        {
            Debug.Log("Created Script Graph in : " + _position);
            VinoveScript CreatedScript = new VinoveScript(_name, _position, _scene.UID);

            _uids.Add(CreatedScript.UID);
            _scene.Scripts.Add(CreatedScript);

            if (ErrorDetector.Instance.IsStringEmpty(_scene.StarterUID))
            {
                _scene.StarterUID = CreatedScript.UID;
            }

            GraphViewer.GraphViewer.UndoStackCreate(CreatedScript.UID, CreatedScript);
        }
Ejemplo n.º 7
0
        public void RestoreGraph(VinoveScript _targetScript)
        {
            if (ErrorDetector.Instance.IsStringHasData(_targetScript.Prev))
            {
                if (_targetScript.Prev.StartsWith("SCE"))
                {
                    VinoveScene _prevScene = FindSceneWithUID(_targetScript.Prev);
                    _prevScene.Next = _targetScript.UID;
                }
                else if (_targetScript.Prev.StartsWith("BRA"))
                {
                    VinoveBranch _prevBranch = FindBranchWithUID(_targetScript.Prev);
                }
                if (_targetScript.Prev.StartsWith("MRG"))
                {
                    VinoveMerge _prevMerge = FindMergeWithUID(_targetScript.Prev);
                    _prevMerge.Next = _targetScript.UID;
                }
            }

            if (ErrorDetector.Instance.IsStringHasData(_targetScript.Next))
            {
                if (_targetScript.Next.StartsWith("SCE"))
                {
                    VinoveScene _nextScene = FindSceneWithUID(_targetScript.Next);
                    _nextScene.Prev = _targetScript.UID;
                }
                else if (_targetScript.Next.StartsWith("BRA"))
                {
                    VinoveBranch _nextBranch = FindBranchWithUID(_targetScript.Next);
                    _nextBranch.Prev = _targetScript.UID;
                }
                if (_targetScript.Next.StartsWith("MRG"))
                {
                    VinoveMerge _nextMerge = FindMergeWithUID(_targetScript.Next);
                }
            }

            VinoveScene _parentScene = FindSceneWithUID(_targetScript.ParentSceneUID);

            _parentScene.Scripts.Add(_targetScript);
            _uids.Add(_targetScript.UID);

            if (ErrorDetector.Instance.IsStringEmpty(_parentScene.StarterUID))
            {
                _parentScene.StarterUID = _targetScript.UID;
            }
        }