TheKingsRace/Assets/Scripts/UI/Lobby/ControlsUI.cs
Evan Nydahl 08453b455a Added a button to show controls in lobby scene.
-Will need to get a UI asset eventually.
-actual control text needs to be  edited to actual controls
2022-04-01 11:37:48 -05:00

48 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class ControlsUI : MonoBehaviour
{
public GameObject controlsMenu;
public TMP_Text ControlsHeader;
public TMP_Text ControlsButtonText;
public TMP_Text ControlsText;
private bool isViewingRunnerControls = true;
public void toggleMenu()
{
//if active, turn off
if (controlsMenu.activeInHierarchy)
{
controlsMenu.SetActive(false);
}
//if off, turn on
else
{
controlsMenu.SetActive(true);
}
}
public void ToggleControlsScreen()
{
if (isViewingRunnerControls)
{
isViewingRunnerControls = false;
ControlsHeader.text = "King Controls";
ControlsButtonText.text = "Runner Controls";
ControlsText.text = "To-Do: Put the King's Controls here";
}
else
{
isViewingRunnerControls = true;
ControlsHeader.text = "Runner Controls";
ControlsButtonText.text = "King Controls";
ControlsText.text = "To-Do: Put the Runner's Controls here";
}
}
}