コード例 #1
0
    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);
    }
コード例 #2
0
ファイル: HeroFactory.cs プロジェクト: cnscj/THSTG
        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);
        }
コード例 #3
0
ファイル: SkillsInfo.cs プロジェクト: satela/xjhU3d
    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;

    }
コード例 #4
0
 public EntityPlayer(int entityID, EHeroType heroType) : base(entityID)
 {
     _heroType = heroType;
 }
コード例 #5
0
ファイル: EntityUtil.cs プロジェクト: cnscj/THSTG
 ///
 public static string GetHeroCode(EHeroType heroType)
 {
     return(string.Format("{0}", 10000000 + 100000 * (int)EEntityType.Hero + 1000 * (int)heroType + 1));
 }