您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
29 行
742 B
29 行
742 B
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);
|
|
}
|
|
|
|
}
|