/// <summary> /// 关闭ARKit功能 /// </summary> /// <param name="_notif"></param> private void TurnOffARKit(Anywhere.Notification _notif) { UnityARSessionNativeInterface.GetARSessionNativeInterface().Pause(); Anywhere.NotifCenter.GetNotice.PostDispatchEvent(Anywhere.NotifEventKey.ARKIT_FOCUS_OFF); Anywhere.NotifCenter.GetNotice.PostDispatchEvent(Anywhere.NotifEventKey.ASSETS_REMOVEALL); Anywhere.NotifCenter.GetNotice.PostDispatchEvent(Anywhere.NotifEventKey.ARKIT_DESTORYARANCHOR); }
private void DestroyARAnchor(Anywhere.Notification _notif) { if (unityARAnchorManager != null) { unityARAnchorManager.Destroy(); } }
/// <summary> /// 开启ARKit功能 /// </summary> /// <param name="_notif"></param> private void TurnOnARKit(Anywhere.Notification _notif) { ARKitWorldTrackingSessionConfiguration sessionConfig = new ARKitWorldTrackingSessionConfiguration(alignmentOptions[currentAlignmentIndex], planeOptions[currentPlaneIndex], true, false); UnityARSessionNativeInterface.GetARSessionNativeInterface().RunWithConfigAndOptions(sessionConfig, runOptions[currentOptionIndex]); Anywhere.NotifCenter.GetNotice.PostDispatchEvent(Anywhere.NotifEventKey.ARKIT_FOCUS_ON); Anywhere.NotifCenter.GetNotice.PostDispatchEvent(Anywhere.NotifEventKey.ARKIT_CREATEARANCHOR); }
private void CreateARAnchor(Anywhere.Notification _notif) { unityARAnchorManager = new UnityARAnchorManager(); UnityARUtility.InitializePlanePrefab(planePrefab); }