예제 #1
0
    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);
    }
예제 #2
0
    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);
    }