예제 #1
0
        public static AdvEditorSettingWindow GetInstance()
        {
            AdvEditorSettingWindow instance = EditorWindow.GetWindow(typeof(AdvEditorSettingWindow)) as AdvEditorSettingWindow;

            instance.Load();
            instance.Close();
            return(instance);
        }
예제 #2
0
        //末尾の空白文字をチェック
        private void CheckWhiteSpaceEndOfCell(Dictionary <string, StringGridDictionary> bookDictionary)
        {
            AdvEditorSettingWindow editorSetting = AdvEditorSettingWindow.GetInstance();

            if (UnityEngine.Object.ReferenceEquals(editorSetting, null))
            {
                return;
            }
            if (!editorSetting.CheckWhiteSpaceOnImport)
            {
                return;
            }

            List <string> ignoreHeader = new List <string>();

            ignoreHeader.Add("Text");
            if (LanguageManagerBase.Instance != null)
            {
                foreach (string language in LanguageManagerBase.Instance.Languages)
                {
                    ignoreHeader.Add(language);
                }
            }

            foreach (StringGridDictionary book in bookDictionary.Values)
            {
                foreach (var sheet in book.Values)
                {
                    List <int> ignoreIndex = new List <int>();
                    foreach (var item in ignoreHeader)
                    {
                        int index;
                        if (sheet.Grid.TryGetColumnIndex(item, out index))
                        {
                            ignoreIndex.Add(index);
                        }
                    }
                    foreach (var row in sheet.Grid.Rows)
                    {
                        if (row.RowIndex == 0)
                        {
                            continue;
                        }

                        for (int i = 0; i < row.Strings.Length; ++i)
                        {
                            string str = row.Strings[i];
                            if (str.Length <= 0)
                            {
                                continue;
                            }
                            if (ignoreIndex.Contains(i))
                            {
                                continue;
                            }

                            int endIndex = str.Length - 1;
                            if (char.IsWhiteSpace(str[endIndex]))
                            {
                                Debug.LogWarning(row.ToErrorString("Last characer is white space [" + ColorUtil.AddColorTag(str, ColorUtil.Red) + "]  \n"));
                            }
                        }
                    }
                }
            }
        }
예제 #3
0
        static void OnChangeScene()
        {
            AdvEditorSettingWindow editorSetting = AdvEditorSettingWindow.GetInstance();

            if (UnityEngine.Object.ReferenceEquals(editorSetting, null))
            {
                return;
            }
            AdvEngine        engine  = null;
            AdvEngineStarter starter = null;

            //宴のシーンが切り替わったら、自動でプロジェクトを変更するか
            if (editorSetting.AutoChangeProject)
            {
                if (engine == null)
                {
                    engine = UtageEditorToolKit.FindComponentAllInTheScene <AdvEngine>();
                }
                starter = UtageEditorToolKit.FindComponentAllInTheScene <AdvEngineStarter>();
                if (engine == null || starter == null)
                {
                    return;
                }

                CheckCurrentProject(engine, starter);
            }

            //宴のシーンが切り替わったら、自動でシーンのチェックをするか
            if (editorSetting.AutoCheckScene)
            {
                engine = UtageEditorToolKit.FindComponentAllInTheScene <AdvEngine>();
                if (engine == null)
                {
                    return;
                }

                //Unityのバージョンアップによる致命的な不具合をチェックする
                if (editorSetting.AutoCheckUnityVersionUp && CheckVersionUpScene(engine))
                {
                    if (EditorUtility.DisplayDialog(
                            "UTAGE Version Up Scene"
                            , LanguageSystemText.LocalizeText(SystemText.VersionUpScene)
                            , LanguageSystemText.LocalizeText(SystemText.Yes)
                            , "Cancel")
                        )
                    {
                        VersionUpScene(engine);
                    }
                }

                if (starter != null && !starter.EditorCheckVersion())
                {
                    AdvScenarioDataProject project = starter.ScenarioDataProject as AdvScenarioDataProject;
                    if (project != null)
                    {
                        if (EditorUtility.DisplayDialog(
                                "UTAGE Version Up Sccenario"
                                , LanguageSystemText.LocalizeText(SystemText.VersionUpScenario)
                                , LanguageSystemText.LocalizeText(SystemText.Yes)
                                , "Cancel")
                            )
                        {
                            AdvScenarioDataBuilderWindow.Import();
                            starter.Scenarios = project.Scenarios;
                            starter.EditorVersionUp();
                        }
                    }
                }
            }
        }