|
@@ -0,0 +1,35 @@
|
|
|
+using Immersal.AR.Nreal;
|
|
|
+using UnityEngine;
|
|
|
+
|
|
|
+public class ControlLocalizer: MonoBehaviour
|
|
|
+{
|
|
|
+ public NRLocalizer NRLocalizer;
|
|
|
+ public GameObject obj;
|
|
|
+ public GameObject irobot;
|
|
|
+
|
|
|
+ private float tra_X;
|
|
|
+ private float tra_Y;
|
|
|
+ private float time = 0f;
|
|
|
+
|
|
|
+
|
|
|
+ private void Start()
|
|
|
+ {
|
|
|
+ tra_X = obj.transform.position.x;
|
|
|
+ tra_Y = obj.transform.position.y;
|
|
|
+ }
|
|
|
+ void Update()
|
|
|
+ {
|
|
|
+ time += Time.deltaTime;
|
|
|
+
|
|
|
+ if(time > 1 && irobot.activeSelf)
|
|
|
+ {
|
|
|
+ NRLocalizer.Localize();
|
|
|
+ time= 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (obj.transform.position.x != tra_X || obj.transform.position.y != tra_Y)
|
|
|
+ {
|
|
|
+ enabled= false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|