/// <summary> /// 从protobuf 解析静态数据到本地 /// </summary> /// <param name="msg"></param> public static void LoadStaticDataToLocal(sdata.StaticDataResponse msg) { ConfigM.Init(msg); buildingM.Init(msg); DeckM.Init(msg); UserM.Init(msg); SoldierM.Init(msg); SummonM.Init(msg); SkillM.Init(msg); StageM.Init(msg); RoleNameM.Init(msg); ItemM.Init(msg); GodSkillM.Init(msg); AthleticsM.Init(msg); ErnieM.Init(msg); FruitionM.Init(msg); ShipPlanM.Init(msg); }
/// <summary> /// 初始化技能数据,从数据中心获取所有技能数据 /// </summary> public override bool Init(int SceneID, LifeMCore Core) { this.m_SceneID = SceneID; m_SkillOwner = CM.GetLifeM(m_SceneID, LifeMType.SUMMONPET) as SummonPet; SummonpetInfo Info = SummonM.GetSummonPetInfo(Core.m_DataID); if (Info == null) { return(false); } //SoldierSkillInfo Info = info.m_Skillinfo; m_attack1 = "0"; m_attack2 = "0"; for (int i = 0; i <= 7; i++) { if (i < Info.m_Skillinfo.Count) { if (Info.m_Skillinfo[i].m_attacktype != (int)AttackType.PassiveCondition && Info.m_Skillinfo[i].m_condition != 0 && Info.m_Skillinfo[i].m_enable == true) { m_ConditionSkill.Add(Info.m_Skillinfo[i]); m_ConditionSkillTimeCount.Add(0f); } m_AllSkill.Add(Info.m_Skillinfo[i]); Info.m_Skillinfo[i].m_LifeTarget = null; Info.m_Skillinfo[i].m_TargetPos = null; } else { m_AllSkill.Add(new SoldierSkill()); } } GetNextSkill(); m_CdTime = m_CDDuration; m_CDDuration = m_AllSkill[0].m_cd; m_Release = false; return(true); }
/// <summary> /// 创建宠物 /// </summary> private SummonPet CreatePet(int PetDataID, MapGrid StartGrid) { SummonpetInfo info = SummonM.GetSummonPetInfo(PetDataID); SummonPet pet = new SummonPet(); pet.CreateSkin(BattleEnvironmentM.GetLifeMBornNode(true), info.m_modeltype, info.m_modeltype.ToString(), AnimatorState.Empty, true); //IGameRole i = GameRoleFactory.Create(BattleEnvironmentM.GetLifeMBornNode(true), info.m_modeltype, info.m_modeltype.ToString(), AnimatorState.Empty); GameObject go = pet.RoleSkinCom.tRoot.gameObject; Vector3 pos = Vector3.zero; string posname = ""; LifeObj lo = go.AddComponent <LifeObj>(); pet.SetSummonPetLife(info, pet.RoleSkinCom.ProPerty, LifeEnvironment.Combat); pet.SetLifeCore(new LifeMCore(PetDataID, true, LifeMType.SUMMONPET, Camp, MoveState.Walk)); pet.SetSkin(); pet.SetBornPos(StartGrid.GridPos, 0); lo.SetLife(pet, pet.RoleSkinCom.ProPerty); go.transform.parent = BattleEnvironmentM.GetLifeMBornNode(true); Vector3 start = StartGrid.WorldPos; start.z = Camera.main.transform.position.z; go.transform.position = start; return(pet); }
/// <summary> /// 获取战斗副本中的道具 /// DataID 道具的id /// </summary> public static SummonProsInfo GetSummonProsInfo(int ID) { return(SummonM.GetSummonProsInfo(ID)); }
/// <summary> /// 获取战斗副本中的宠物信息 /// </summary> public static PetInfo GetPetInfo(int ID) { return(SummonM.GetPetInfo(ID)); }