Skip to content

Commit

Permalink
Illusion cavnas toggler added
Browse files Browse the repository at this point in the history
  • Loading branch information
syKevinPeng committed Apr 30, 2024
1 parent e679773 commit 1833915
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Assets/Scripts/MenuController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@ private void RepositionCanvas()
public void EnableMenu()
{
MenuCanvas.SetActive(true);
// hide canvas
IllusionCanvas.SetActive(false);
// pause the game
Time.timeScale = 0;
}
public void DisableMenu()
{
MenuCanvas.SetActive(false);
// show canvas
IllusionCanvas.SetActive(true);
// resume the game
Time.timeScale = 1;
}
Expand All @@ -57,8 +53,9 @@ void GetMenuButtonReleased()
public void GetToggleState()
{
// get the state of the toggle
ToggleState = MenuCanvas.transform.Find("Toggle").GetComponent<UnityEngine.UI.Toggle>().isOn;
ToggleState = MenuCanvas.transform.Find("Toggle").transform.Find("Switcher").GetComponent<UISwitcher.UISwitcher>().isOn;
Debug.LogError(ToggleState);
IllusionCanvas.SetActive(ToggleState);
}

void Start()
Expand Down

0 comments on commit 1833915

Please sign in to comment.