コード例 #1
0
ファイル: Entity.cs プロジェクト: facybenbook/Aneroe
 // Damages character, returns true if character is at 0 health
 public virtual void Damage(float amount, int dirFrom, float stunTime, float stunVel)
 {
     stats.ChangeStat("health", -amount);
     controller.RespondToEntityAction(this, "health");
     if (stats.GetStat("health") <= 0)
     {
         Kill();
     }
     else if (anim.GetInteger("state") != (int)CharacterState.Immobile)
     {
         anim.SetInteger("state", (int)CharacterState.Immobile);
         stunTimer    = stunTime;
         stunVelocity = stunVel * directionVectors[dirFrom - 1];
         oldRendColor = sRend.color;
         sRend.color  = new Color(1, 0, 0, 1);
     }
 }