Inheritance: ScriptableObject
コード例 #1
0
        //ブックのインポート
        void ImportScenarioBook(StringGridDictionary book, string path)
        {
            //シナリオデータ用のスクリプタブルオブジェクトを宣言
            string scenarioAssetPath = Path.ChangeExtension(path, ScenarioAssetExt);
            AdvScenarioDataExported assetScenario = null;

            foreach (var sheet in book.List)
            {
                StringGrid grid = sheet.Grid;
                //設定データか、シナリオデータかチェック
                if (!AdvSettingDataManager.IsBootSheet(sheet.Name) && !AdvSettingDataManager.IsSettingsSheet(sheet.Name))
                {
                    //シナリオデータのアセットを作成
                    if (assetScenario == null)
                    {
                        assetScenario = UtageEditorToolKit.GetImportedAssetCreateIfMissing <AdvScenarioDataExported>(scenarioAssetPath);
                        assetScenario.Clear();
                    }
                    assetScenario.hideFlags = HideFlags.NotEditable;
                    assetScenario.ParseFromExcel(sheet.Name, grid);
                    if (assetSetting != null)
                    {
                        AdvScenarioData scenarioData = assetScenario.ErrorCheck(sheet.Name, grid, assetSetting);
                        scenarioDataTbl.Add(sheet.Name, scenarioData);
                    }
                }
            }

            //変更を反映
            if (assetScenario != null)
            {
                Debug.Log(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.Import, scenarioAssetPath));
                EditorUtility.SetDirty(assetScenario);
            }
        }
コード例 #2
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();
        }
コード例 #3
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);
        }
コード例 #4
0
		/// <summary>
		/// 設定されたエクスポートデータからゲームを開始
		/// </summary>
		/// <param name="rootDirResource">リソースディレクトリ</param>
		public void BootFromExportData(AdvSettingDataManager settingDataManager, AdvScenarioDataExported[] exportedScenarioDataTbl, string resourceDir )
		{
			StopAllCoroutines();
			Clear();
			isStarted = true;
			isWaitBootLoading = true;
			onPreInit.Invoke();
			DataManager.InitData( settingDataManager, exportedScenarioDataTbl);
			BootInit(resourceDir);
			isWaitBootLoading = false;
		}
コード例 #5
0
		//スクリプトから初期化
		public void InitOnCreate(AdvEngine engine, AdvSettingDataManager settingDataManager, AdvScenarioDataExported[] exportedScenarioDataTbl, string rootResourceDir)
		{
			this.engine = engine;
			this.settingDataManager = settingDataManager;
			this.exportedScenarioDataTbl = exportedScenarioDataTbl;
			this.rootResourceDir = rootResourceDir;
		}
コード例 #6
0
		/// <summary>
		/// データを直接設定して初期化
		/// </summary>
		public void InitData(AdvSettingDataManager settingDataManager, AdvScenarioDataExported[] exportedScenarioDataTbl)
		{
			this.settingDataManager = settingDataManager;
			this.exportedScenarioDataTbl = exportedScenarioDataTbl;
		}