Exemplo n.º 1
0
        private bool AddSurfacePoint(Vector3 surfacePoint)
        {
            Vector2 localPoint;

            if (!_quad.ProjectSurfaceToLocal(surfacePoint, out localPoint))
            {
                print("out of bounds");
                return(false);
            }
            _surfaceLines.Last().Add(_quad.OffsetForDrawing(surfacePoint));
            _localLines.Last().Add(localPoint);
            return(true);
        }
        private bool AddWorldPoint(Vector3 worldPoint)
        {
            Vector3 surfacePoint;

            if (!_quad.ProjectWorldToSurface(CameraPosition.position, worldPoint, out surfacePoint))
            {
                print("Could not raycast from camera to target");
                return(false);
            }

            _worldLines.Last().Add(worldPoint);
            _surfaceLines.Last().Add(_quad.OffsetForDrawing(surfacePoint));
            return(true);
        }