Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
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
        }
Ejemplo n.º 3
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);
            }
        }