示例#1
0
        //シーン内のAdvエンジンの初期設定
        void InitUtageEngine()
        {
            //シナリオデータの設定
            AdvEngine        engine  = GameObject.FindObjectOfType <AdvEngine>();
            AdvEngineStarter starter = GameObject.FindObjectOfType <AdvEngineStarter>();

            AdvSettingDataManager   settingDataAsset      = UtageEditorToolKit.LoadAssetAtPath <AdvSettingDataManager>(GetSettingAssetRelativePath());
            AdvScenarioDataExported exportedScenarioAsset = UtageEditorToolKit.LoadAssetAtPath <AdvScenarioDataExported>(GetScenarioAssetRelativePath());

            AdvScenarioDataExported[] exportedScenarioDataTbl = { exportedScenarioAsset };
            starter.InitOnCreate(engine, settingDataAsset, exportedScenarioDataTbl, newProjectName);

            UguiLetterBoxCamera[] cameras = GameObject.FindObjectsOfType <UguiLetterBoxCamera>();
            foreach (UguiLetterBoxCamera camera in cameras)
            {
                camera.Width  = camera.MaxWidth = gameScreenWidth;
                camera.Height = camera.MaxHeight = gameScreenHeight;
            }

            //セーブファイルの場所の設定
            AdvSaveManager saveManager = GameObject.FindObjectOfType <AdvSaveManager>();

            saveManager.DirectoryName = "Save" + newProjectName;

            AdvSystemSaveData systemSaveData = GameObject.FindObjectOfType <AdvSystemSaveData>();

            systemSaveData.DirectoryName = "Save" + newProjectName;

            //シーン内の全てのテンプレートアセットをクローンアセットに置き換える
            ReplaceAssetsFromTempleateToCloneInSecne();
        }
示例#2
0
        //現在の宴プロジェクトをチェック
        static void CheckCurrentProject(AdvEngine engine, AdvEngineStarter starter)
        {
            AdvScenarioDataProject project = starter.ScenarioDataProject as AdvScenarioDataProject;

            if (project == null)
            {
                Selection.activeObject = starter;
                Debug.LogWarning("Set using project asset to 'Editor > Scenario Data Project' ", starter);
                return;
            }

            if (AdvScenarioDataBuilderWindow.ProjectData != project)
            {
                AdvScenarioDataBuilderWindow.ProjectData = project;


/*				if (EditorUtility.DisplayDialog(
 *                                      "CheckCurrentProject"
 *                                      , LanguageSystemText.LocalizeText(SystemText.ChangeCurrentProject)
 *                                      , LanguageSystemText.LocalizeText(SystemText.Yes)
 *                                      , LanguageSystemText.LocalizeText(SystemText.No))
 *                                      )
 *                              {
 *                                      AdvScenarioDataBuilderWindow.ProjectData = project;
 *                              }
 */
            }
        }
示例#3
0
        //現在の宴プロジェクトをチェック
        static void CheckCurrentProject(AdvEngine engine, AdvEngineStarter starter)
        {
            AdvScenarioDataProject project = starter.ScenarioDataProject as AdvScenarioDataProject;

            if (project == null)
            {
                Selection.activeObject = starter;
                Debug.LogWarning("Set using project asset to 'Editor > Scenario Data Project' ", starter);
                return;
            }

            if (AdvScenarioDataBuilderWindow.ProjectData != project)
            {
                AdvScenarioDataBuilderWindow.ProjectData = project;
            }
        }
示例#4
0
        void DrawProperties()
        {
            AdvEngineStarter obj = target as AdvEngineStarter;

            UtageEditorToolKit.PropertyField(serializedObject, "engine", "Engine");
            UtageEditorToolKit.PropertyField(serializedObject, "isLoadOnAwake", "Is Load On Awake");
            UtageEditorToolKit.PropertyField(serializedObject, "isAutomaticPlay", "Is Automatic Play");
            UtageEditorToolKit.PropertyField(serializedObject, "startScenario", "Start Scenario Label");

            //シナリオデータ
            UtageEditorToolKit.BeginGroup("Scenario Data");
            UtageEditorToolKit.PropertyField(serializedObject, "scenarioDataLoadType", "LoadType");
            switch (obj.ScenarioDataLoadType)
            {
            case AdvEngineStarter.LoadType.Local:
                UtageEditorToolKit.PropertyField(serializedObject, "settingDataManager", "Setting Data Manager");
                UtageEditorToolKit.PropertyFieldArray(serializedObject, "exportedScenarioDataTbl", "Exported Scenario Data Tbl");
                break;

            case AdvEngineStarter.LoadType.Server:
                UtageEditorToolKit.PropertyField(serializedObject, "urlScenarioData", "URL Scenario Data");
                UtageEditorToolKit.PropertyField(serializedObject, "scenarioVersion", "Boot File Version");
                break;
            }
            UtageEditorToolKit.EndGroup();


            //リソースデータ
            UtageEditorToolKit.BeginGroup("Resource Data");
            UtageEditorToolKit.PropertyField(serializedObject, "resourceLoadType", "LoadType");
            switch (obj.ResourceLoadType)
            {
            case AdvEngineStarter.LoadType.Local:
                UtageEditorToolKit.PropertyField(serializedObject, "rootResourceDir", "Root Dir");
                break;

            case AdvEngineStarter.LoadType.Server:
                UtageEditorToolKit.PropertyField(serializedObject, "urlResourceDir", "URL Resource Dir");
                break;
            }
            UtageEditorToolKit.EndGroup();
        }
示例#5
0
        void InitUtageEngine()
        {
            //シナリオデータの設定
            AdvEngine        engine  = GameObject.FindObjectOfType <AdvEngine>();
            AdvEngineStarter starter = GameObject.FindObjectOfType <AdvEngineStarter>();

            AdvSettingDataManager   settingDataAsset      = UtageEditorToolKit.LoadAssetAtPath <AdvSettingDataManager>(GetSettingAssetRelativePath());
            AdvScenarioDataExported exportedScenarioAsset = UtageEditorToolKit.LoadAssetAtPath <AdvScenarioDataExported>(GetScenarioAssetRelativePath());

            AdvScenarioDataExported[] exportedScenarioDataTbl = { exportedScenarioAsset };
            starter.InitOnCreate(engine, settingDataAsset, exportedScenarioDataTbl, newProjectName);

            //カメラに画面サイズを設定
            CameraManager cameraManager = GameObject.FindObjectOfType <CameraManager>();

            cameraManager.InitOnCreate(gameScreenWidth, gameScreenHeight);
            //入力枠のサイズ調整
            AdvInputManager inputManager = GameObject.FindObjectOfType <AdvInputManager>();
            BoxCollider2D   collider     = inputManager.GetComponent <BoxCollider2D>();

            collider.size = new Vector2(1.0f * gameScreenWidth / 100, 1.0f * gameScreenHeight / 100);
        }
        //シーン内のAdvエンジンの初期設定
        void InitUtageEngine()
        {
            //シナリオデータの設定
            AdvEngine        engine  = GameObject.FindObjectOfType <AdvEngine>();
            AdvEngineStarter starter = GameObject.FindObjectOfType <AdvEngineStarter>();

//			AdvScenarioDataExported exportedScenarioAsset = UtageEditorToolKit.LoadAssetAtPath<AdvScenarioDataExported>(GetScenarioAssetRelativePath());
//			AdvScenarioDataExported[] exportedScenarioDataTbl = { exportedScenarioAsset };
            starter.InitOnCreate(engine, AdvScenarioDataBuilderWindow.ProjectData.Scenarios, newProjectName);
            starter.ScenarioDataProject = AdvScenarioDataBuilderWindow.ProjectData;

            LetterBoxCamera[] cameras = GameObject.FindObjectsOfType <LetterBoxCamera>();
            foreach (LetterBoxCamera camera in cameras)
            {
                camera.Width  = camera.MaxWidth = gameScreenWidth;
                camera.Height = camera.MaxHeight = gameScreenHeight;
            }

            //セーブファイルの場所の設定
            AdvSaveManager saveManager = GameObject.FindObjectOfType <AdvSaveManager>();

            saveManager.DirectoryName = "Save" + newProjectName;

            AdvSystemSaveData systemSaveData = GameObject.FindObjectOfType <AdvSystemSaveData>();

            systemSaveData.DirectoryName = "Save" + newProjectName;

            //シークレットキーの設定
            FileIOManager[] fileIOManagers = GameObject.FindObjectsOfType <FileIOManager>();
            foreach (FileIOManager item in fileIOManagers)
            {
                item.SetCryptKey(this.secretKey);
            }

            //シーン内の全てのテンプレートアセットをクローンアセットに置き換える
            ReplaceAssetsFromTemplateToCloneInSecne();
        }
示例#7
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();
                        }
                    }
                }
            }
        }
        void DrawProperties()
        {
            AdvEngineStarter obj = target as AdvEngineStarter;

            UtageEditorToolKit.PropertyField(serializedObject, "engine", "Engine");
            UtageEditorToolKit.PropertyField(serializedObject, "isLoadOnAwake", "Is Load On Awake");
            UtageEditorToolKit.PropertyField(serializedObject, "isAutomaticPlay", "Is Automatic Play");
            UtageEditorToolKit.PropertyField(serializedObject, "startScenario", "Start Scenario Label");

            //シナリオデータ
            UtageEditorToolKit.BeginGroup("Scenario Data");
            UtageEditorToolKit.PropertyField(serializedObject, "scenarioDataLoadType", "LoadType");
            switch (obj.ScenarioDataLoadType)
            {
            case AdvEngineStarter.LoadType.Local:
                UtageEditorToolKit.PropertyField(serializedObject, "scenarios", "Scenarios");
//					UtageEditorToolKit.PropertyField(serializedObject, "settingDataManager", "Setting Data Manager");
//					UtageEditorToolKit.PropertyFieldArray(serializedObject, "exportedScenarioDataTbl", "Exported Scenario Data Tbl");
                break;

            case AdvEngineStarter.LoadType.Server:
                UtageEditorToolKit.PropertyField(serializedObject, "urlScenarioData", "URL Scenario Data");
                UtageEditorToolKit.PropertyField(serializedObject, "scenarioVersion", "Boot File Version");
                UtageEditorToolKit.PropertyFieldArray(serializedObject, "chapterUrlList", "Chapter URL List");
                break;
            }
            UtageEditorToolKit.EndGroup();


            //リソースデータ
            UtageEditorToolKit.BeginGroup("Resource Data");
            UtageEditorToolKit.PropertyField(serializedObject, "resourceLoadType", "LoadType");
            switch (obj.ResourceLoadType)
            {
            case AdvEngineStarter.LoadType.Local:
                UtageEditorToolKit.PropertyField(serializedObject, "rootResourceDir", "Root Dir");
                UtageEditorToolKit.PropertyField(serializedObject, "useConvertFileListOnLocal", "Convert File List");
                UtageEditorToolKit.PropertyField(serializedObject, "useAssetBundleListOnLocal", "Asset Bundle List");
                break;

            case AdvEngineStarter.LoadType.Server:
                UtageEditorToolKit.PropertyField(serializedObject, "urlResourceDir", "URL Resource Dir");
                UtageEditorToolKit.PropertyField(serializedObject, "useConvertFileListOnServer", "Convert File List");
                UtageEditorToolKit.PropertyField(serializedObject, "useAssetBundleListOnServer", "Asset Bundle List");
                break;
            }
            UtageEditorToolKit.EndGroup();

            //リソースデータ
            UtageEditorToolKit.BeginGroup("Load Setting");
            UtageEditorToolKit.PropertyField(serializedObject, "isAutomaticInitFileLoadSetting", "Is Automatic Init");

            UtageEditorToolKit.PropertyField(serializedObject, "localLoadSetting", "Local Load Setting");
            UtageEditorToolKit.PropertyField(serializedObject, "serverLoadSetting", "Server Load Setting");

            UtageEditorToolKit.EndGroup();


            //エディターのみ
            UtageEditorToolKit.BeginGroup("Editor");
            UtageEditorToolKit.PropertyField(serializedObject, "scenarioDataProject", "Scenario Data Project");
            if (!(obj.ScenarioDataProject is AdvScenarioDataProject))
            {
                obj.ScenarioDataProject = null;
            }
            UtageEditorToolKit.EndGroup();
        }