Ejemplo n.º 1
0
        public static void DrawFlatArrow(UnityEngine.Vector3 center, UnityEngine.Vector3 direction, UnityEngine.Vector3 forward, float handleSize)
        {
            var matrix = SceneHandles.matrix;

            SceneHandles.matrix = UnityEngine.Matrix4x4.identity;

            center = matrix.MultiplyPoint(center);
            var xdir = matrix.MultiplyVector(direction).normalized;
            var ydir = Vector3.Cross(xdir, matrix.MultiplyVector(forward)).normalized;

            ydir *= 0.3f * handleSize;
            xdir *= handleSize;

            arrowPoints[0] = center;
            arrowPoints[1] = center + (xdir - ydir);
            arrowPoints[2] = center + (xdir + ydir);
            SceneHandles.DrawAAConvexPolygon(arrowPoints);

            SceneHandles.matrix = matrix;
        }