private void OnMonsterHitHandler(object sender, MonsterDetectionEvent.MonsterHitEventArgs e) { //if(e.hitbox.healthLost >= 5) // Play(takeMoreThan5damage); //else Play(takeDamage); Play(takeDamage2); }
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); } }
private void OnMonsterHitHandler(object sender, MonsterDetectionEvent.MonsterHitEventArgs e) { Play(takeDamage); }
private void OnMonsterHitHandler(object sender, MonsterDetectionEvent.MonsterHitEventArgs e) { gotHit = true; _faceAnimator.SetTrigger("Hit"); }