Пример #1
0
        public static void Text(string text)
        {
            var origin       = ApiManager.Instance.BrushPosition;
            var font         = Resources.Load <CHRFont>("arcade");
            var textToStroke = new TextToStrokes(font);
            var polyline2d   = textToStroke.Build(text);

            DrawStrokes.MultiPositionPathsToStrokes(polyline2d, null, null, origin);
        }
Пример #2
0
        public static void BrushDraw(float distance)
        {
            Vector3 directionVector = ApiManager.Instance.BrushRotation * Vector3.forward;
            var     end             = directionVector * distance;
            var     path            = new List <List <Vector3> >
            {
                new List <Vector3> {
                    Vector3.zero, end
                }
            };
            var origin = ApiManager.Instance.BrushPosition;

            DrawStrokes.MultiPositionPathsToStrokes(path, null, null, origin);
            ApiManager.Instance.BrushPosition += end;
        }
Пример #3
0
        public static void DrawCameraPath(int index)
        {
            CameraPathWidget widget = WidgetManager.m_Instance.CameraPathWidgets.ElementAt(index).WidgetScript;
            CameraPath       path   = widget.Path;
            var positions           = new List <Vector3>();
            var rotations           = new List <Quaternion>();

            for (float t = 0; t < path.Segments.Count; t += .1f)
            {
                positions.Add(path.GetPosition(new PathT(t)));
                rotations.Add(path.GetRotation(new PathT(t)));
            }
            DrawStrokes.MultiPositionPathsToStrokes(
                new List <List <Vector3> > {
                positions
            },
                new List <List <Quaternion> > {
                rotations
            },
                null,
                Vector3.zero
                );
        }