Ejemplo n.º 1
0
    // If player is destroyed by enemy attack or enemy/stage collision
    public void PlayerDie()
    {
        canControl           = false;
        updateOptionsOnSpawn = true;    // Reset Option Spawn flag

        // Play explosion
        Instantiate(dieExplosion, transform.position, transform.rotation);

        // [WIP] If player still has lives, proceed with respawn sequence

        // Set respawn sequence
        animator.SetBool("Player_Respawn", true);   // Set respawn flag in animator to 'true' to allow respawn invincibility sequence upon reentry.
        animator.SetTrigger("Player_WasKilled");    //

        // Cancel laser attack animation sequence
        if (currPow_2_attack_laser >= 1)
        {
            attackController.ResetLaser();

            // Cancel for each active Option
            for (int i = 0; i < currPow_4_optionCount; i++)
            {
                options[i].attackController.ResetLaser();
            }
        }

        // Disable all Options
        UpdateOptionActive(false);

        // Reset player power ups
        PlayerPowerReset();

        // [WIP] Nullify all enemy attacks for brief amount of time (2-3 seconds after respawn)
    }