private void TouchTracker() { Touch touch; if (Input.touchCount < 1 || (touch = Input.GetTouch(0)).phase != TouchPhase.Began) { return; } Vector3 t = (Vector3)touch.position + Vector3.forward * 3; Vector3 f = m_firstPersonCamera.ScreenToWorldPoint(t);//.ScreenPointToRay(touch.position).direction; Arsenal.fire(POVShip.main.gameObject, 0, POVShip.location() + f * 0.06f, f); /*TrackableHit hit; * TrackableHitFlag raycastFilter = TrackableHitFlag.PlaneWithinBounds | TrackableHitFlag.PlaneWithinPolygon; * * if (Session.Raycast(m_firstPersonCamera.ScreenPointToRay(touch.position), raycastFilter, out hit)) * { * // Create an anchor to allow ARCore to track the hitpoint as understanding of the physical * // world evolves. * var anchor = Session.CreateAnchor(hit.Point, Quaternion.identity); * }*/ }
// Use this for initialization private void Awake() { main = this; }