|
@@ -0,0 +1,46 @@
|
|
|
+using Blue;
|
|
|
+using UnityEngine;
|
|
|
+
|
|
|
+public class PointCouldAutoMatchController : AbstractController
|
|
|
+{
|
|
|
+ public GameObject AR_Map;
|
|
|
+ public GameObject obj_A;
|
|
|
+ public Vector3 obj_AVec;
|
|
|
+
|
|
|
+ public GameObject obj_origin;
|
|
|
+ public Vector3 OriginVec;
|
|
|
+
|
|
|
+ public BindableProperty<float> A_X ;
|
|
|
+
|
|
|
+ public Vector2 pos1;
|
|
|
+ public Vector2 pos2;
|
|
|
+ public double angle;
|
|
|
+
|
|
|
+ private void Awake()
|
|
|
+ {
|
|
|
+ A_X = new BindableProperty<float>(obj_A.transform.position.x);
|
|
|
+ A_X.Subscribe(PointChange);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void PointChange(float obj)
|
|
|
+ {
|
|
|
+ Auto();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void Auto()
|
|
|
+ {
|
|
|
+ angle = this.GetUtility<IGetAngleByTwoPointUtility>().GetAngleByTwoPoint(pos1,pos2);
|
|
|
+ AR_Map.transform.localEulerAngles = new Vector3(0.0f, (float)angle, 0.0f);
|
|
|
+ AR_Map.transform.localEulerAngles = new Vector3(0.0f, 16.6f, 0.0f);
|
|
|
+ AR_Map.transform.localPosition = OriginVec;
|
|
|
+ }
|
|
|
+
|
|
|
+ void Update()
|
|
|
+ {
|
|
|
+ OriginVec = obj_origin.transform.position;
|
|
|
+
|
|
|
+ obj_AVec = obj_A.transform.position;
|
|
|
+
|
|
|
+ A_X.Value = obj_A.transform.position.x;
|
|
|
+ }
|
|
|
+}
|