void OnEnable() { blinking = false; physic.enabled = true; physic.SetVelocityX(velX); physic.SetVelocityY(velY); ZRotationStep.z = ZRotationFactorInitial; spriteRenderer.enabled = true; }
public void OnDamageReceived(ProjectileProperties projectileProp, int newHP) { if (newHP > 0) { return; } else { animManager.PlayDeathAnimation(projectileProp, DeathAnimCB); movementManager.StopMoving(); inputManager.enabled = false; gameObject.layer = 2; if (projectileProp.type == ProjectileType.Grenade) { physic.SetVelocityY(3); physic.SetVelocityX(-transform.right.x / 3); } else if (projectileProp.type == ProjectileType.Knife) { EventManager.TriggerEvent(GlobalEvents.PlayerStabbed); } audioManager.PlaySound(2); } }