示例#1
0
    public void Hurt(float rawDamage)
    {
        if (lastHit + invulnerableInterval < Time.time)
        {
            //Hp--;
            //todo fix hp add
            if (Hp < 0)
            {
                //dead
            }
            else
            {
                Avatar.ApplyDamage(rawDamage);
                FMOD.Studio.EventInstance hurtSound = FMODUnity.RuntimeManager.CreateInstance("event:/Combat/Injured");
                hurtSound.start();
                StartCoroutine(HurtDelay());
            }

            lastHit = Time.time;
        }
    }