API using UnityEngine; using UnityEngine.Events; using System.Collections; public class ExampleClass : MonoBehaviour { UnityEvent m_MyEvent; void Start() { if (m_MyEvent == null) m_MyEvent = new UnityEvent(); m_MyEvent.AddListener(Ping); } void Update() { if (Input.anyKeyDown && m_MyEvent != null) { m_MyEvent.Invoke(); } } void Ping() { Debug.Log("Ping"); } }
The Unity XR plug-in framework provides the basis for XR development in Unity. You can add support for an XR device to a project by installing and enabling the relevant XR plug-in. You can add or remove plug-ins to the project at any time.
See Project set up for instructions on how to add XR plug-ins to your project using the XR Plug-in Management system.
Unity supports the following XR plug-ins:
See XR Platform System Requirements for system requirements for developing XR projects in Unity.
注意:
HLVR1.0