2 using UnityEngine.Serialization;
17 [FormerlySerializedAs(
"speed")]
public float Speed = 1.0f;
27 private Vector3 accumDelta;
34 if (!
Misc.IsARDevice())
36 var arCamera = GameObject.Find(
"AR Camera");
40 arCamera.tag =
"Untagged";
41 arCamera.SetActive(
false);
44 GetComponent<Camera>().gameObject.SetActive(
true);
47 (o = gameObject).AddComponent<AudioListener>();
57 var rotation = transform.rotation;
58 rotationX = rotation.eulerAngles.x;
59 rotationY = rotation.eulerAngles.y;
65 var forward = Vector3.ProjectOnPlane(transform.forward,
new Vector3(0, 1, 0));
67 var initialPosition = transform.position;
69 if (Input.GetKey(
"w"))
72 forward *
Speed, Space.World
76 if (Input.GetKey(
"s"))
79 -forward *
Speed, Space.World
83 if (Input.GetKey(
"d"))
86 transform.right *
Speed, Space.World
90 if (Input.GetKey(
"a"))
93 -transform.right *
Speed, Space.World
97 if (Input.GetKey(
"up"))
100 transform.up *
Speed, Space.World
104 var finalPosition = transform.position;
105 var delta = finalPosition - initialPosition;
107 var locMngr = ARLocationProvider.Instance;
109 if (firstLocation ==
null)
111 firstLocation = locMngr.CurrentLocation.ToLocation();
114 accumDelta += delta * 0.00001f;
125 transform.localRotation = Quaternion.Euler(rotationX, rotationY, 0);