private EntityPlayer CreatePlayer(EHeroType heroType, Vector3 pos, Vector3 rot) { CfgPlayerTable playerTable = CfgPlayer.Instance.GetConfigTable((int)heroType); if (playerTable == null) { return(null); } EntityPlayer player = new EntityPlayer(++EntityID, heroType); player.Create(this, playerTable.AvatarID, pos, rot); return(player); }
public GameEntity CreateHero(EHeroType heroType, EPlayerType playerType = EPlayerType.Player01) { string code = EntityUtil.GetHeroCode(heroType); var entity = CreateEntity(code); var playerDataCom = entity.GetComponent(GameComponentsLookup.PlayerData) as PlayerDataComponent; if (playerDataCom != null) { playerDataCom.playerType = playerType; EntityCache.GetInstance().SetHero(playerType, entity); } return(entity); }
public List<SkillInfo> getHeroSkill(EHeroType herotype) { List<SkillInfo> list = new List<SkillInfo>(); if(herotype == EHeroType.Magician) { foreach(SkillInfo info in skillInfoDic.Values) { if (info.applicableRole == ApplicableRole.Magician) list.Add(info); } } else if (herotype == EHeroType.Swordman) { foreach (SkillInfo info in skillInfoDic.Values) { if (info.applicableRole == ApplicableRole.Swordman) list.Add(info); } } return list; }
public EntityPlayer(int entityID, EHeroType heroType) : base(entityID) { _heroType = heroType; }
/// public static string GetHeroCode(EHeroType heroType) { return(string.Format("{0}", 10000000 + 100000 * (int)EEntityType.Hero + 1000 * (int)heroType + 1)); }