private bool LoadDigimon(string monsterGroupId, AdventureDigimonInfo digimonInfo) { bool result = true; try { MonsterClientMaster monsterMasterByMonsterGroupId = MonsterMaster.GetMonsterMasterByMonsterGroupId(monsterGroupId); string modelId = monsterMasterByMonsterGroupId.Group.modelId; string path = MonsterObject.GetFilePath(modelId); GameObject original = AssetDataMng.Instance().LoadObject(path, null, true) as GameObject; GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original); gameObject.name = "Digimon_" + monsterGroupId; gameObject.transform.parent = ClassSingleton <AdventureSceneData> .Instance.scriptObjectRoot.transform; gameObject.SetActive(false); digimonInfo.model = gameObject; List <GameWebAPI.RespDataMA_GetSkillM.SkillM> list; if (!this.LoadUniqueSkill(monsterGroupId, out list)) { throw new Exception("Error : 固有スキルの読み込みに失敗"); } for (int i = 0; i < list.Count; i++) { int num = list[i].skillGroupSubId.ToInt32(); int num2 = num - 1; path = CommonResourcesDataMng.Instance().GetUniqueSkillPrefabPathByAttackEffectId(list[i].attackEffect); original = (AssetDataMng.Instance().LoadObject(path, null, true) as GameObject); gameObject = UnityEngine.Object.Instantiate <GameObject>(original); gameObject.name = "SkillEffect_" + list[i].attackEffect; gameObject.transform.parent = ClassSingleton <AdventureSceneData> .Instance.scriptObjectRoot.transform; gameObject.SetActive(false); digimonInfo.skillEffectList[num2] = gameObject; InvocationEffectParams component = gameObject.GetComponent <InvocationEffectParams>(); path = CommonResourcesDataMng.Instance().GetCameraMotionPrefabPathByCameraId(component.cameraMotionId); original = (AssetDataMng.Instance().LoadObject(path, null, true) as GameObject); gameObject = UnityEngine.Object.Instantiate <GameObject>(original); gameObject.name = "CameraAnime_" + component.cameraMotionId; gameObject.transform.parent = ClassSingleton <AdventureSceneData> .Instance.scriptObjectRoot.transform; gameObject.SetActive(false); digimonInfo.skillCameraAnimation[num2] = gameObject; digimonInfo.skillEffectSeList[num2] = list[i].soundEffect; } } catch { result = false; digimonInfo.Delete(); } return(result); }
public override bool RunScriptCommand() { bool result = true; string stagePrefabPathByAttackEffectId = CommonResourcesDataMng.Instance().GetStagePrefabPathByAttackEffectId(this.stageFileName); GameObject original = AssetDataMng.Instance().LoadObject(stagePrefabPathByAttackEffectId, null, true) as GameObject; GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original); ClassSingleton <AdventureSceneData> .Instance.stage = gameObject; gameObject.name = "Stage"; gameObject.transform.parent = ClassSingleton <AdventureSceneData> .Instance.scriptObjectRoot.transform; LightColorChanger sunLightColorChanger = ClassSingleton <AdventureSceneData> .Instance.adventureLight.gameObject.AddComponent <LightColorChanger>(); BattleCameraObject battleCameraObject = gameObject.AddComponent <BattleCameraObject>(); battleCameraObject.sunLight = ClassSingleton <AdventureSceneData> .Instance.adventureLight; battleCameraObject.camera3D = ClassSingleton <AdventureSceneData> .Instance.adventureCamera.camera3D; battleCameraObject.sunLightColorChanger = sunLightColorChanger; StageParams component = gameObject.GetComponent <StageParams>(); component.SetHierarchyEnviroments(battleCameraObject); base.ResumeScriptEngine(); return(result); }