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