public void HitByEarth(Vector2 direction) { living = false; rigidBody.constraints = RigidbodyConstraints2D.None; NStateSpiked spiked = (NStateSpiked)movementStates[8]; spiked.SetSpikedDirection(direction); movementState.SetBool("spiked", true); bloodParticles.Play(); ReleaseAllWeapons(); levelManager.RemovePlayer(gameObject); }
public void DeathBySpikes(bool h) { living = false; rigidBody.constraints = RigidbodyConstraints2D.None; NStateSpiked spiked = (NStateSpiked)movementStates[8]; Vector2 direction = h ? new Vector2(rigidBody.velocity.x, -rigidBody.velocity.y * 0.5f) : new Vector2(-rigidBody.velocity.x, rigidBody.velocity.y); spiked.SetSpikedDirection(direction); movementState.SetBool("spiked", true); bloodParticles.Play(); ReleaseAllWeapons(); levelManager.RemovePlayer(gameObject); }