50 lines
772 B
C#
50 lines
772 B
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class OptionsManager : MonoBehaviour
|
|
{
|
|
public enum OptionsTabs
|
|
{
|
|
OPTIONS = 0,
|
|
CONTROLS = 1,
|
|
CONTROLLER = 2,
|
|
VR = 3
|
|
}
|
|
|
|
public OptionsTabs currentTab;
|
|
|
|
public List<GameObject> tabs = new List<GameObject>();
|
|
|
|
private void Start()
|
|
{
|
|
for (int i = 0; i < tabs.Count; i++)
|
|
{
|
|
tabs[i].SetActive(false);
|
|
}
|
|
if (VRManager.IsVROn())
|
|
{
|
|
ChangeTab(OptionsTabs.VR);
|
|
}
|
|
else
|
|
{
|
|
ChangeTab(OptionsTabs.OPTIONS);
|
|
}
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
}
|
|
|
|
public void ChangeTab(int tabID)
|
|
{
|
|
ChangeTab((OptionsTabs)tabID);
|
|
}
|
|
|
|
public void ChangeTab(OptionsTabs optionsTabs)
|
|
{
|
|
tabs[(int)currentTab].SetActive(false);
|
|
currentTab = optionsTabs;
|
|
tabs[(int)currentTab].SetActive(true);
|
|
}
|
|
}
|