29 lines
490 B
C#
29 lines
490 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class VRControllersToggle : MonoBehaviour
|
|
{
|
|
[HideInInspector]
|
|
public Toggle toggle;
|
|
|
|
private void OnEnable()
|
|
{
|
|
if (toggle == null)
|
|
{
|
|
toggle = GetComponent<Toggle>();
|
|
}
|
|
if ((bool)VRControllersManager.Instance)
|
|
{
|
|
toggle.isOn = VRControllersManager.Instance.handsVisible;
|
|
}
|
|
}
|
|
|
|
public void ValueChanged()
|
|
{
|
|
if ((bool)VRControllersManager.Instance)
|
|
{
|
|
VRControllersManager.Instance.ShowHands(toggle.isOn);
|
|
}
|
|
}
|
|
}
|