Example #1
0
    public void OnDrawGizmos()
    {
        DrawWires();

        if (hitbox != null)
        {
            GizmoTurtle turtle = new GizmoTurtle(transform.position);
            GizmoFont   font   = new RobotLetters(turtle, 0.4f);

            turtle.PenUp().RotateRight(90).Forward(0.12f).RotateLeft(90).Forward(0.15f);
            font.Write(hitbox.name);
        }
    }
    void DrawWire(string label, Vector3 to)
    {
        GizmoTurtle  turtle = new GizmoTurtle(new Ray(transform.position, to - transform.position));
        RobotLetters font   = new RobotLetters(turtle, 0.1f);

        turtle.PenDown().Forward(0.2f).RotateLeft(90).Forward(0.05f).RotateRight(120).Forward(0.1f).RotateRight(150).Forward(0.1f).RotateRight(180);
        turtle.PenUp().Forward(0.15f);

        font.Write(Regex.Replace(label, @"[A-Z]", " $0").Trim());

        turtle.PenUp().Forward(0.05f);
        turtle.PenDown().Forward(Vector3.Distance(turtle.Position, to));
    }
    public void DrawLabel()
    {
        GizmoTurtle.WithGizmoColor(Color.white, () =>
        {
            GizmoTurtle turtle = new GizmoTurtle(transform.position);
            RobotLetters font  = new RobotLetters(turtle, 0.1f);

            turtle.Forward(0.15f);
            turtle.RotateRight(90);
            turtle.Forward(0.02f);
            turtle.RotateLeft(90);
            font.Write(Regex.Replace(name, @"[A-Z]", " $0").Trim());
        });
    }