29 lines
444 B
C#
29 lines
444 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class VRCurvedUIToggle : MonoBehaviour
|
|
{
|
|
[HideInInspector]
|
|
public Toggle toggle;
|
|
|
|
private void OnEnable()
|
|
{
|
|
if (toggle == null)
|
|
{
|
|
toggle = GetComponent<Toggle>();
|
|
}
|
|
if ((bool)VRManager.Instance)
|
|
{
|
|
toggle.isOn = VRManager.Instance.useCurvedUI;
|
|
}
|
|
}
|
|
|
|
public void ValueChanged()
|
|
{
|
|
if ((bool)VRManager.Instance)
|
|
{
|
|
VRManager.Instance.SetCurvedUI(toggle.isOn);
|
|
}
|
|
}
|
|
}
|