コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        Vector2 screenCenter = ScreenUtils.GetScreenCenter();

        ////Raycast returns true/false
        //if (rayCastManager.Raycast(screenCenter, hits, TrackableType.PlaneWithinPolygon))
        //{
        //    //reposition the recticle
        //    RepositionRecticle();
        //}
    }
コード例 #2
0
    public void DrawOnTouch()
    {
        Touch touch = Input.GetTouch(0);

        if (touch.phase == TouchPhase.Began || touch.phase == TouchPhase.Moved || touch.phase == TouchPhase.Stationary)
        {
            Vector2 screenCenter = ScreenUtils.GetScreenCenter();
            Ray     ray          = ARCamera.ScreenPointToRay(screenCenter);

            if (Physics.Raycast(ray, out RaycastHit hitObject))
            {
                //DebugManager.Instance.LogInfo($"hitTransform is {hitObject.point}, {CanDraw}");
                Draw(hitObject.point);
            }
        }
        else if (touch.phase == TouchPhase.Ended)
        {
            TraceLines.Remove(touch.fingerId);
        }
    }