mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-13 22:09:53 -05:00
28 lines
870 B
C#
28 lines
870 B
C#
using System.Linq;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
|
|
namespace VRM.FirstPersonSample
|
|
{
|
|
public class CanvasManager : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
public Button LoadVRMButton;
|
|
|
|
[SerializeField]
|
|
public Button LoadBVHButton;
|
|
|
|
private void Reset()
|
|
{
|
|
#if UNITY_2022_3_OR_NEWER
|
|
LoadVRMButton = GameObject.FindObjectsByType<Button>(FindObjectsSortMode.InstanceID).FirstOrDefault(x => x.name == "LoadVRM");
|
|
LoadBVHButton = GameObject.FindObjectsByType<Button>(FindObjectsSortMode.InstanceID).FirstOrDefault(x => x.name == "LoadBVH");
|
|
#else
|
|
LoadVRMButton = GameObject.FindObjectsOfType<Button>().FirstOrDefault(x => x.name == "LoadVRM");
|
|
LoadBVHButton = GameObject.FindObjectsOfType<Button>().FirstOrDefault(x => x.name == "LoadBVH");
|
|
#endif
|
|
}
|
|
}
|
|
}
|