//シーン内の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(); }
/// <summary> /// 初期化 /// </summary> /// <param name="data">セーブデータ</param> /// <param name="index">インデックス</param> public void Init(AdvSceneGallerySettingData data, int index, AdvSystemSaveData saveData ) { bool isOpend = saveData.GalleryData.CheckSceneLabels(data.ScenarioLabel); ListViewItem.IsEnableButton = isOpend; if (!isOpend) { texture.LocalAlpha = 0; title.text = ""; } else{ texture.SetTextureFile(data.ThumbnailPath, pixelsToUnits); title.text = data.Title; } }
/// <summary> /// 初期化 /// </summary> /// <param name="data">セーブデータ</param> /// <param name="index">インデックス</param> public void Init(AdvSceneGallerySettingData data, Action<UtageUguiSceneGalleryItem> ButtonClickedEvent, AdvSystemSaveData saveData ) { this.data = data; UnityEngine.UI.Button button = this.GetComponent<UnityEngine.UI.Button>(); button.onClick.AddListener( ()=>ButtonClickedEvent(this) ); bool isOpend = saveData.GalleryData.CheckSceneLabels(data.ScenarioLabel); button.interactable = isOpend; if (!isOpend) { texture.gameObject.SetActive(false); if (title) title.text = ""; } else{ texture.gameObject.SetActive(true); texture.LoadTextureFile(data.ThumbnailPath); if (title) title.text = data.Title; } }
//シーン内の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(); }