Files
UltimateFishing/Assets/Scripts/Assembly-CSharp/VRPlayerFollowCameraToggle.cs
2026-02-21 16:45:37 +08:00

29 lines
471 B
C#

using UnityEngine;
using UnityEngine.UI;
public class VRPlayerFollowCameraToggle : MonoBehaviour
{
[HideInInspector]
public Toggle toggle;
private void OnEnable()
{
if (toggle == null)
{
toggle = GetComponent<Toggle>();
}
if ((bool)VRManager.Instance)
{
toggle.isOn = VRManager.Instance.playerFollowCamera;
}
}
public void ValueChanged()
{
if ((bool)VRManager.Instance)
{
VRManager.Instance.SetPlayerFollowCamera(toggle.isOn);
}
}
}