public CharacterCameraView(MonsterData monsterData, int width, int height) { GameObject gameObject = GUIManager.LoadCommonGUI("Render3D/Render3DRT", null); this.csRender3DRT = gameObject.GetComponent <CommonRender3DRT>(); if (!monsterData.userMonster.IsEgg()) { string filePath = MonsterObject.GetFilePath(monsterData.GetMonsterMaster().Group.modelId); this.csRender3DRT.LoadChara(filePath, 0f, 10000f, -0.65f, 1.1f, true); this.csRender3DRT.SetBillBoardCamera(); } else { string eggModelId = MonsterObject.GetEggModelId(monsterData.userMonster.monsterEvolutionRouteId); string filePath2 = MonsterObject.GetFilePath(eggModelId); this.csRender3DRT.LoadEgg(filePath2, 0f, 10000f, 0.1f); } this.renderTex = this.csRender3DRT.SetRenderTarget(width, height, 16); this.defaultPos = Camera.main.ScreenToViewportPoint(new Vector3(-382f, -80f, 0f)); this.defaultPos.x = -0.6f; this.orignal = this.csRender3DRT.projectionMatrix; Matrix4x4 lhs = Matrix4x4.TRS(this.defaultPos, Quaternion.identity, Vector3.one); this.csRender3DRT.projectionMatrix = lhs * this.orignal; this.pinch = new PinchInOut(); }
private CommonRender3DRT CreateRender3DRT(bool isEgg, string modelId, UITexture displayUiTex) { GameObject gameObject = GUIManager.LoadCommonGUI("Render3D/Render3DRT", null); gameObject.name = "DigiGarden3dStudio_" + this.charaActList.Count.ToString(); CommonRender3DRT component = gameObject.GetComponent <CommonRender3DRT>(); string filePath = MonsterObject.GetFilePath(modelId); if (!isEgg) { component.LoadChara(filePath, 0f, 4000f, 0f, 0f, true); } else { component.LoadEgg(filePath, 0f, 4000f, 0f); } gameObject = UnityEngine.Object.Instantiate <GameObject>(this.digiShadow.gameObject); GardenShadow component2 = gameObject.GetComponent <GardenShadow>(); component2.Initialize(component.gameObject); RenderTexture mainTexture = component.SetRenderTarget(displayUiTex.width, displayUiTex.height, 16); displayUiTex.mainTexture = mainTexture; return(component); }
private bool LoadDigimonNotCharaParams(string monsterGroupId, AdventureDigimonInfo digimonInfo) { bool result = true; try { MonsterClientMaster monsterMasterByMonsterGroupId = MonsterMaster.GetMonsterMasterByMonsterGroupId(monsterGroupId); string modelId = monsterMasterByMonsterGroupId.Group.modelId; string filePath = MonsterObject.GetFilePath(modelId); GameObject original = AssetDataMng.Instance().LoadObject(filePath, 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; CharacterParams component = gameObject.GetComponent <CharacterParams>(); UnityEngine.Object.Destroy(component); CapsuleCollider component2 = gameObject.GetComponent <CapsuleCollider>(); UnityEngine.Object.Destroy(component2); Transform transform = gameObject.transform; for (int i = 0; i < transform.childCount; i++) { Animation component3 = transform.GetChild(i).GetComponent <Animation>(); UnityEngine.Object.Destroy(component3); } } catch { result = false; } return(result); }
private void ShowCharacter() { this.ngTargetTex = this.goTargetTex.GetComponent <UITexture>(); GameObject gameObject = GUIManager.LoadCommonGUI("Render3D/Render3DRT", null); this.csRender3DRT = gameObject.GetComponent <CommonRender3DRT>(); string filePath = MonsterObject.GetFilePath(CMD_MealExecution.DataChg.GetMonsterMaster().Group.modelId); this.csRender3DRT.LoadChara(filePath, 0f, 4000f, -0.65f, 1.1f, true); this.renderTex = this.csRender3DRT.SetRenderTarget(1136, 820, 16); this.ngTargetTex.mainTexture = this.renderTex; this.charaParams = this.csRender3DRT.transform.GetComponentInChildren <CharacterParams>(); }
public static GameObject LoadMonsterModel(Transform parentTransform, string modelId) { GameObject gameObject = null; string filePath = MonsterObject.GetFilePath(modelId); GameObject gameObject2 = AssetDataMng.Instance().LoadObject(filePath, null, true) as GameObject; if (null != gameObject2) { gameObject = UnityEngine.Object.Instantiate <GameObject>(gameObject2); Transform transform = gameObject.transform; transform.parent = parentTransform; } return(gameObject); }
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 List <string> GetCharaModelPathList(int partyNo) { List <string> list = new List <string>(); if (this.listRoot.fastSetPartObjs != null && this.listRoot.fastSetPartObjs.Count > partyNo) { List <MonsterData> nowMD = this.listRoot.fastSetPartObjs[partyNo].GetNowMD(); for (int i = 0; i < nowMD.Count; i++) { string filePath = MonsterObject.GetFilePath(nowMD[i].GetMonsterMaster().Group.modelId); list.Add(filePath); } } return(list); }
public void ShowCharacter() { if (this.Data == null) { this.ngTargetTex.gameObject.SetActive(false); this.ShowDet(); return; } this.SetRenderPos(); GameObject gameObject = GUIManager.LoadCommonGUI("Render3D/Render3DRT", null); this.csRender3DRT = gameObject.GetComponent <CommonRender3DRT>(); string filePath = MonsterObject.GetFilePath(this.Data.GetMonsterMaster().Group.modelId); this.csRender3DRT.LoadChara(filePath, this.v3Chara.x, this.v3Chara.y, 0.1f, 0f, false); this.renderTex = this.csRender3DRT.SetRenderTarget(320, 378, 16); this.ngTargetTex.gameObject.SetActive(true); this.ngTargetTex.mainTexture = this.renderTex; GameWebAPI.RespDataMA_GetMonsterMG.MonsterM monsterMG = this.Data.monsterMG; float partyCharaPosX = 0f; float partyCharaPosY = 0f; float partyCharaPosZ = 0f; float partyCharaRotY = 0f; if (!string.IsNullOrEmpty(monsterMG.partyCharaPosX)) { partyCharaPosX = (float)double.Parse(monsterMG.partyCharaPosX); } if (!string.IsNullOrEmpty(monsterMG.partyCharaPosY)) { partyCharaPosY = (float)double.Parse(monsterMG.partyCharaPosY); } if (!string.IsNullOrEmpty(monsterMG.partyCharaPosZ)) { partyCharaPosZ = (float)double.Parse(monsterMG.partyCharaPosZ); } if (!string.IsNullOrEmpty(monsterMG.partyCharaRotY)) { partyCharaRotY = (float)double.Parse(monsterMG.partyCharaRotY); } this.csRender3DRT.SetCharacterPositionForParty(partyCharaPosX, partyCharaPosY, partyCharaPosZ, partyCharaRotY); this.updateCharaCT = 2; this.ShowDet(); }
public void ShowMonster(MonsterData[] monsterDataList) { List <string> list = new List <string>(); for (int i = 0; i < monsterDataList.Length; i++) { string filePath = MonsterObject.GetFilePath(monsterDataList[i].GetMonsterMaster().Group.modelId); list.Add(filePath); } this.monsterCount = list.Count; GameObject gameObject = GUIManager.LoadCommonGUI("Render3D/Render3DPartyRT", null); this.monsterRenderTexture = gameObject.GetComponent <CommonRender3DPartyRT>(); this.monsterRenderTexture.SetCameraBackgroundColor(this.renderTextureColor); this.monsterRenderTexture.LoadCharas(list, this.rootPosition.x, this.rootPosition.y); this.renderTargetTexture.gameObject.SetActive(true); this.renderTargetTexture.mainTexture = this.monsterRenderTexture.SetRenderTarget(1136, 820, 16); this.monsterRenderTexture.SetAnimation(CharacterAnimationType.attacks); }
private void SpawnMonster(string modelId, float scale, int index) { string filePath = MonsterObject.GetFilePath(modelId); GameObject gameObject = UnityEngine.Object.Instantiate(AssetDataMng.Instance().LoadObject(filePath, null, true)) as GameObject; gameObject.name = "DIGIMON_" + index; int mask = LayerMask.NameToLayer("UI3D"); Util.SetLayer(gameObject, mask); Transform transform = gameObject.transform; this.monsterTransforms[index] = transform; transform.SetParent(this.threeDCameraTrans); transform.localScale = new Vector3(scale, scale, scale); transform.localPosition = Vector3.up * 3000f; transform.rotation = Quaternion.Euler(0f, 180f, 0f); CharacterParams component = gameObject.GetComponent <CharacterParams>(); component.PlayAnimation(CharacterAnimationType.idle, SkillType.Attack, 0, null, null); }
private IEnumerator LoadDigimon(string modelId) { string path = MonsterObject.GetFilePath(modelId); GameObject resource = AssetDataMng.Instance().LoadObject(path, null, true) as GameObject; yield return(null); this.digimon = UnityEngine.Object.Instantiate <GameObject>(resource); CharacterParams param = this.digimon.GetComponent <CharacterParams>(); param.SetShadowObject(); this.digimon.SetActive(false); yield return(null); this.digimon.transform.parent = base.transform; this.digimon.transform.localPosition = Vector3.zero; this.digimon.transform.localRotation = Quaternion.identity; this.digimon.transform.localScale = Vector3.one; this.digimon.tag = "Farm.Chara"; resource = null; Resources.UnloadUnusedAssets(); yield break; }
private IEnumerator PreloadSpawnMonsters() { AssetBundleMng.Instance().SetLevel(string.Empty); string p17 = MonsterObject.GetFilePath("17"); string p18 = MonsterObject.GetFilePath("74"); string p19 = MonsterObject.GetFilePath("152"); bool finish = false; AssetDataMng.Instance().LoadObjectASync(p17, delegate(UnityEngine.Object _obj) { finish = true; }); while (!finish) { yield return(null); } finish = false; AssetDataMng.Instance().LoadObjectASync(p18, delegate(UnityEngine.Object _obj) { finish = true; }); while (!finish) { yield return(null); } finish = false; AssetDataMng.Instance().LoadObjectASync(p19, delegate(UnityEngine.Object _obj) { finish = true; }); while (!finish) { yield return(null); } yield break; }
public virtual void LoadEggModel(string modelId, Vector3 characterPosition, float characterEulerAngleY) { string filePath = MonsterObject.GetFilePath(modelId); this.renderTextureCamera.LoadEgg(filePath, this.renderTextureCamera.transform.localPosition.x, this.renderTextureCamera.transform.localPosition.y, characterPosition.y); }
public virtual void LoadMonsterModel(string modelId, Vector3 characterPosition, float characterEulerAngleY) { string filePath = MonsterObject.GetFilePath(modelId); this.renderTextureCamera.LoadMonsterModel(filePath, characterPosition, characterEulerAngleY); }