|
@@ -1,8 +1,11 @@
|
|
|
+using System.Collections;
|
|
|
using Immersal.AR;
|
|
|
using Blue;
|
|
|
using UnityEngine.UI;
|
|
|
using UnityEngine;
|
|
|
using Immersal;
|
|
|
+using NRKernal;
|
|
|
+using XRTool.Util;
|
|
|
|
|
|
|
|
|
|
|
@@ -33,12 +36,17 @@ public class IsLocation : AbstractController
|
|
|
N_Location_Toggle.transform.Find("Background").GetComponent<Image>().color = white;
|
|
|
N_Location_Toggle.transform.Find("Background/Checkmark").GetComponent<Image>().color = white;
|
|
|
|
|
|
- ImmersalSDK.Instance.Localizer.NewLocalize();
|
|
|
XRLocalizer.enabled = true;
|
|
|
-
|
|
|
- this.SendCommand(new SetImmersalLocalCommand(true));
|
|
|
+ StartCoroutine(StartNewLocalize());
|
|
|
}
|
|
|
}
|
|
|
+ IEnumerator StartNewLocalize()
|
|
|
+ {
|
|
|
+ yield return null;
|
|
|
+ Ref();
|
|
|
+ this.SendCommand(new SetImmersalLocalCommand(true));
|
|
|
+ }
|
|
|
+
|
|
|
private void N_IsLocationValueChange(bool isOn)
|
|
|
{
|
|
|
if (isOn)
|
|
@@ -53,4 +61,30 @@ public class IsLocation : AbstractController
|
|
|
this.SendCommand(new SetImmersalLocalCommand(false));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void Ref()
|
|
|
+ {
|
|
|
+ ImmersalSDK.Instance.Localizer.Reset();
|
|
|
+ NRSessionManager.Instance.NRHMDPoseTracker.ChangeTo0Dof((result) =>
|
|
|
+ {
|
|
|
+ TimerMgr.Instance.CreateTimer(() => {
|
|
|
+
|
|
|
+ NRSessionManager.Instance.NRHMDPoseTracker.ChangeTo6Dof((result) =>
|
|
|
+ {
|
|
|
+ var poseTracker = NRSessionManager.Instance.NRHMDPoseTracker;
|
|
|
+ poseTracker.ResetWorldMatrix(false);
|
|
|
+ ImmersalSDK.Instance.Localizer.Reset();
|
|
|
+ NRInput.RecenterController();
|
|
|
+ SetLocalTime.isActive = true;
|
|
|
+ });
|
|
|
+
|
|
|
+ }, 1f);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ public static class SetLocalTime
|
|
|
+ {
|
|
|
+ public static bool isActive = false;
|
|
|
+ public static bool isFind = true;
|
|
|
+ }
|
|
|
}
|