chunk 1: core gameplay scripts scenes runtime assets
This commit is contained in:
29
Assets/Scripts/Behaviours/UI/UIContextPanelsBehaviour.cs
Normal file
29
Assets/Scripts/Behaviours/UI/UIContextPanelsBehaviour.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class UIContextPanelsBehaviour : MonoBehaviour
|
||||
{
|
||||
public GameObject[] contextPanels;
|
||||
private int currentContextPanelID;
|
||||
|
||||
public void SetupContextPanels()
|
||||
{
|
||||
currentContextPanelID = 0;
|
||||
|
||||
for(int i = 0; i < contextPanels.Length; i++)
|
||||
{
|
||||
contextPanels[i].SetActive(false);
|
||||
}
|
||||
|
||||
contextPanels[currentContextPanelID].SetActive(true);
|
||||
}
|
||||
|
||||
public void UpdateContextPanels(int newContextPanelID)
|
||||
{
|
||||
contextPanels[currentContextPanelID].SetActive(false);
|
||||
currentContextPanelID = newContextPanelID;
|
||||
contextPanels[currentContextPanelID].SetActive(true);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user