Calculate() 공개 메소드

public Calculate ( Combatant, ts, float damageFactor ) : CombatantAnimation[]
ts Combatant,
damageFactor float
리턴 CombatantAnimation[]
예제 #1
0
 public int Damage(BattleAction action)
 {
     int id = this.GetBattleID();
     if(this.combatant != null &&
         (!this.combatant.isDead || action.reviveFlag))
     {
         CombatantAnimation[] anims = action.Calculate(
                 new Combatant[] {this.combatant}, this.damageFactor);
         if(anims.Length > 0)
         {
             string name = this.combatant.GetAnimationName(anims[0]);
             if(name != "" && this.combatant.prefabInstance != null &&
                 this.combatant.prefabInstance.animation != null &&
                 this.combatant.prefabInstance.animation[name] &&
                 (DataHolder.BattleSystem().playDamageAnim ||
                 !this.combatant.IsInAction() ||
                 !(DataHolder.BattleSystem().dynamicCombat ||
                 DataHolder.BattleSystem().IsRealTime())))
             {
                 this.combatant.prefabInstance.animation.CrossFade(name, 0.3f, PlayMode.StopSameLayer);
             }
         }
     }
     return id;
 }