fgm24/Assets/Scripts/GameOverMainMenuReturnerBut...

29 lines
694 B
C#
Raw Permalink Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2024-02-06 14:32:09 +01:00
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;
public class GameOverMainMenuReturnerButtonScriptForLoadingTheMainMenuSceneOnceAPlayerHasDiedAndHasThenPressedTheMainMenuButtonOnTheGameOverScreen : MonoBehaviour
{
2024-02-04 10:31:50 +01:00
public void r() {
2024-02-04 16:32:14 +01:00
AudioManager.Instance.StopAllAudio();
2024-02-04 10:31:50 +01:00
SceneManager.LoadScene(0);
}
2024-02-06 14:32:09 +01:00
void Update()
{
foreach (var controller in Gamepad.all)
{
if (controller.crossButton.IsPressed())
{
r();
return;
}
}
if (Input.anyKeyDown)
r();
}
}