示例#1
0
    public void OnResetLevel()
    {
        //currentHealth = playerStats.MaxHealth;
        //currentStamina = playerStats.MaxStamina;
        AkSoundEngine.SetState("Dead_or_Alive", "Alive");
        deathParticles.Stop();
        deathParticles.Clear();
        playerStats.resetHealth();
        playerStats.resetStamina();
        isDead = false;

        KinematicTestController.runningRight = respawnRunDirection == PlayerRespawnDirection.Right ? 1 : -1; //-1 is running left, 1 is running right.

        if (CheckpointManager.GetCurerntCheckpoint() != Vector3.zero)
        {
            Debug.Log(CheckpointManager.GetCurerntCheckpoint());
            GetComponentInParent <KinematicTestController>().Motor.SetPosition(CheckpointManager.GetCurerntCheckpoint());
        }
        else
        {
            GetComponentInParent <KinematicTestController>().Motor.SetPosition(currentSpawnPosition);
        }
        playerStats.SetCurrentZoeRecolor(playerStats.selectedSkin); //Ensures that the player sets the selected skin on levelStart
    }