Firstborn/Assets/RPG Creation Kit/Scripts/Player/_General/PlayerDeathScreen.cs
Schaken-Mods 959e80cf72 assets upload
assets upload description.
2023-03-28 12:16:30 -05:00

59 lines
1.3 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using RPGCreationKit;
using UnityEngine.SceneManagement;
namespace RPGCreationKit.Player
{
public class PlayerDeathScreen : MonoBehaviour
{
public static PlayerDeathScreen instance;
public GameObject ui;
public GameObject buttonsT;
public Button defaultButton;
[SerializeField] private LoadPanel loadPanel;
private void Awake()
{
if(instance == null)
instance = this;
}
public void ShowDeathScreen()
{
RckInput.input.SwitchCurrentActionMap("DeathUI");
Time.timeScale = 0;
ui.SetActive(true);
OnShowingUp();
RckPlayer.instance.mouseLook.UnlockCursor();
}
public void OnShowingUp()
{
buttonsT.SetActive(true);
if (RckInput.isUsingGamepad)
defaultButton.Select();
}
public void LoadButton()
{
loadPanel.gameObject.SetActive(true);
if (RckInput.isUsingGamepad)
loadPanel.SelectFirstElementInList();
}
public void QuitButton()
{
SceneManager.LoadScene("_MainMenu_");
}
}
}