public AttackTowerInfo(int indexId, int towerId) { this.Id = indexId; this.charId = towerId; this.eventDispatcher = new MiniEventDispatcher(); this.towerData = J_Tower.GetData(towerId); this.towerBase = towerData._towerBase; this.shooter = towerData._Shooter; this.towerType = towerData._towerType; towerStateMachine = new StateMachine(); towerAtk = new TowerAtk(this); towerIdle = new TowerIdle(this); attackSkillList = new List <SkillInfo>(); attackSkillList.Add(GetSpaceSkillInfo()); attackSkill = SkillManager.getInstance().AddSkill(2, this); //若有弓手,攻击时长为弓手攻击动作 if (this.shooter != null) { attackTime = AnimationCache.getInstance().getAnimation(this.shooter).getMeshAnimation("attack").getAnimTime(); } //若没有弓手,攻击时长为塔身攻击动作 else { attackTime = AnimationCache.getInstance().getAnimation(this.towerBase).getMeshAnimation("attack").getAnimTime(); } }
public AttackTowerInfo(int indexId, CharacterPrototype proto) : base(indexId, proto) { towerStateMachine = new StateMachine(); towerAtk = new TowerAtk(this); towerIdle = new TowerIdle(this); towerConstructing = new TowerConstructing(this); attackSkill = SkillManager.getInstance().AddSkill(this.towerData._attackId, this); }