示例#1
0
 private void OnMonsterHitHandler(object sender, MonsterDetectionEvent.MonsterHitEventArgs e)
 {
     //if(e.hitbox.healthLost >= 5)
     //    Play(takeMoreThan5damage);
     //else
     Play(takeDamage);
     Play(takeDamage2);
 }
示例#2
0
    private void OnMonsterHit(object sender, MonsterDetectionEvent.MonsterHitEventArgs e)
    {
        // spawn FX at location, fx depend on life lost
        if (hitParticles != null)
        {
            ParticleSystem fx = null;
            if (parent != null)
            {
                fx = Instantiate(hitParticles, e.collisionPosition, Quaternion.identity, parent);
            }
            else
            {
                fx = Instantiate(hitParticles, e.collisionPosition, Quaternion.identity, transform);
            }

            //float newScale = Mathf.Lerp(1, scaleFor20healthLost, (float)e.hitbox.healthLost / (float)20);
            fx.transform.localScale = new Vector3(scale, scale, scale);
            Destroy(fx, hitParticles.main.duration + 5f);
        }
    }
示例#3
0
 private void OnMonsterHitHandler(object sender, MonsterDetectionEvent.MonsterHitEventArgs e)
 {
     Play(takeDamage);
 }
示例#4
0
 private void OnMonsterHitHandler(object sender, MonsterDetectionEvent.MonsterHitEventArgs e)
 {
     gotHit = true;
     _faceAnimator.SetTrigger("Hit");
 }