void SetRoleModelViewInfo() { NewCharacterConfigData configData = LoginDataManager.Instance.GetNewCharacterConfigData(SelectRoleItem.ItemDataInfo.byKind); this.HeroModelCamera.ShowRoleModel(configData); var item = ItemDataManager.Instance.GetItemData(SelectRoleItem.ItemDataInfo.WeaponResID); if (item != null) { var weaponEff = (ItemDataManager.Instance.GetItemData(item._goodID) as EquipmentData).WeaponEff; this.HeroModelCamera.ChangeWeapon(PlayerFactory.Instance.GetWeaponPrefab(item._ModelId), weaponEff); } else { this.HeroModelCamera.ChangeWeapon(PlayerFactory.Instance.GetDefulWeaponPrefab(SelectRoleItem.ItemDataInfo.byKind), null); } if (SelectRoleItem.ItemDataInfo.FasionResID == 0) { StartCoroutine(this.HeroModelCamera.ChangeDefulsFashion()); } else { StartCoroutine(this.HeroModelCamera.ChangeFashion(SelectRoleItem.ItemDataInfo.FasionResID)); } //this.HeroModelCamera.PlayerSelectRoleAnimation(); StartCoroutine(LatePlayerSelectRoleAnimation()); }
void AssemblyPlayer(NewCharacterConfigData configData) { //特效 if (configData.EffectPrefab != null) { //this.m_effect = GameObjectPool.Instance.AcquireLocal(configData.EffectPrefab, Vector3.zero, Quaternion.identity); } else { //this.m_effect = GameObject.CreatePrimitive(PrimitiveType.Cube); } //英雄 playerGenerateConfigData = LoginDataManager.Instance.GetPlayerGenerateConfigData(configData.VocationID); this.m_hero = RoleGenerate.GenerateRole(playerGenerateConfigData.PlayerName, playerGenerateConfigData.DefaultAvatar, true); this.m_hero.transform.parent = transform; this.m_hero.transform.localPosition = new Vector3(0, 0, 180); this.m_hero.transform.localRotation = Quaternion.Euler(new Vector3(0, 180, 0)); RoleGenerate.AttachAnimation(this.m_hero, playerGenerateConfigData.PlayerName, playerGenerateConfigData.DefaultAnim, playerGenerateConfigData.Animations); //GameObject weapon = GameManager.Instance.PlayerFactory.Weapons.FirstOrDefault(P => P.name == configData.WeaponName); GameObject weapon = configData.Weapon; TraceUtil.Log("weapon:" + weapon); this.ChangeWeapon(weapon, null); //this.m_effect.transform.parent = m_hero.transform; //this.m_effect.transform.localPosition = Vector3.zero; //this.m_effect.transform.localScale = Vector3.one; }
public void OnSelectRole(int rolePosition) { var roleId = ConvertPosToRoleId(rolePosition); NewCharacterConfigData configData = LoginDataManager.Instance.GetNewCharacterConfigData(roleId); SoundManager.Instance.PlaySoundEffect(configData.ChooseVoice); this.HeroModelCamera.ShowRoleModel(configData); this.HeroNameEditor.SetHeroSex(roleId); //this.HeroModelCamera.PlayerCreatRoleAnimation(); StartCoroutine(LatePlayerCreatRoleAnimation()); //DescribeLable.spriteName = configData.Introductions; }
private static void MakePlayGenerateConfigDataList(string xmlFileName, string sheetName) { string path = Path.Combine(RESOURCE_CHARACTER_DATA_FOLDER, xmlFileName + ".xml"); TextReader tr = new StreamReader(path); string text = tr.ReadToEnd(); if (text == null) { Debug.LogError("Equipment item file not exist"); return; } else { XmlSpreadSheetReader.ReadSheet(text, sheetName); XmlSpreadSheet sheet = XmlSpreadSheetReader.Output; string[] keys = XmlSpreadSheetReader.Keys; object[] levelIds = sheet[keys[0]]; List <NewCharacterConfigData> tempList = new List <NewCharacterConfigData>(); for (int i = 2; i < levelIds.Length; i++) { NewCharacterConfigData data = new NewCharacterConfigData(); //data.m_SzName = Convert.ToString(sheet["szName"][i]); //data.m_IEquipmentID = Convert.ToInt32(sheet["lEquimentID"][i]); data.VocationID = Convert.ToInt32(sheet["VocationID"][i]); data.Picture = Convert.ToString(sheet["Picture"][i]); data.Model = Convert.ToString(sheet["Model"][i]); string Weapon = Convert.ToString(sheet["Weapon"][i]); if (!string.IsNullOrEmpty(Weapon) && Weapon != "0") { var displayPath = Path.Combine(ASSET_CHARACTER_DATA_PREFAB_FOLDER, Weapon + ".prefab"); var displayGo = AssetDatabase.LoadAssetAtPath(displayPath, typeof(GameObject)) as GameObject; data.Weapon = displayGo; } data.WeaponPosition = Convert.ToString(sheet["WeaponPosition"][i]); string AnimationTime = Convert.ToString(sheet["Animations"][i]); data.AnimationsStr = Convert.ToString(sheet["Animations"][i]); data.SelectAnimationsStr = Convert.ToString(sheet["SelectAni"][i]); data.Introductions = Convert.ToString(sheet["Introductions"][i]); data.EffectName = Convert.ToString(sheet["EffectName"][i]); data.EffectPrefab = (GameObject)Resources.LoadAssetAtPath("Assets/Effects/Prefab/" + data.EffectName + ".prefab", typeof(GameObject)); data.EffectTime = Convert.ToSingle(sheet["EffectTime"][i]); data.SelectAniSound = Convert.ToString(sheet["SelectAniSound"][i]); data.ChooseVoice = Convert.ToString(sheet["ChooseVoice"][i]); data.PostprocessorAnimation(); tempList.Add(data); } CreateMedicamentConfigDataList(tempList); } }
public void ShowRoleModel(NewCharacterConfigData configData) { if (this.m_hero != null) { StopAllCoroutines(); Destroy(m_hero); } m_configData = configData; AssemblyPlayer(configData); //StartCoroutine(PlayerCreatRoleAnimation()); StartCoroutine(SetModelPosition()); //SetModelPosition(); }