Git Product home page Git Product logo

unityvisualdebugging's Introduction

Unity Visual Debugging

Small package for drawing debug lines & shapes, as well as debugging variable values during runtime.


Visual Debugger

Uses pooled line renderers for rendering wireframe shapes in a scene.

Usage

Just like with UnityEngine.Debug methods, simply call the desired method(s) of Zenvin.VisualDebugging.VisualDebugger once a frame for every shape you want to be drawn.

Draw methods list

  • DrawCircle - Draws a circle at a given position, a given rotation and a given number of vertices.
  • DrawLine - Draws a line between two points.
  • DrawPath - Draws a path between any number of points.
  • DrawRay - Draws a line starting at a given point, going in a given direction for a given length.
  • DrawRectangle - Draws a rectangle of a given size at a given position.
  • DrawSphere - Draws a wire sphere of a given size at a given position. The circles making up the sphere have 32 vertices each.

Value Debugger

Allows the display of labelled values via OnGUI.
Func<string> delegate methods are used to update displayed values in a specific interval. This defaults to once every 0.25 seconds, but may be set manually using SetUpdateInterval(float)

Usage

To display a value, simply call the static method RegisterTarget(DebugTarget) on Zenvin.VisualDebugging.ValueDebugger, passing it a valid target.

Zenvin.VisualDebugging.ValueDebugger.RegisterTarget(new DebugTarget(Foo, "Some Value"));    // assuming Foo is a method with return type string.

The RegisterTarget(DebugTarget) method will return a numeric ID, which can be used to remove the value from display again using RemoveTarget(int).

Gizmo Utility

A collection of static methods to expand the functionalilty of Unity's Gizmos class.

DrawGizmos methods list

  • DrawArrow - Draws an arrow between two points, with a given normal, size, and color.
  • DrawLine - Draws a line between two points with a given color.
  • DrawPointLines - Draws 3 lines of variable length and color that intersect at a given point.
  • DrawRay - Draws a ray of a given color.
  • DrawWireAngle - Draws the outline of an angle at a given position, rotation and with a given radius and color.
  • DrawWireAngle - Draws a circle at a given position, rotation and with a given radius and color.
  • DrawRect - Draws a rect at a given position, with a given size, rotation and color.

unityvisualdebugging's People

Contributors

zenvin-dev avatar

Stargazers

sunguangdong avatar  avatar  avatar

Watchers

 avatar

Forkers

r2d2m

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.