Skip to content

SceneViewHandles is a lightweight extension which allows you to view and edit variables by only adding one attribute.

License

Notifications You must be signed in to change notification settings

Mckenon/SVHandles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scene View Handles SVHandles is a lightweight extension for Unity which allows you to quickly visualize and modify variables such as Vector3 and Bounds by simply adding [SVHandle] to the variable, and nothing else.

SVHandle Example

The Following code produces this visual:

    [SVHandle]
    public Vector3 MyPoint = new Vector3(0, 10, 0);

Handle Example

Extendability

So let's say you had some custom type you use often, that you would like to debug with this as well. That's easy, all you need to do is have a class in your project which inherits SVHandleDisplay. For reference, here is how the code looks for drawing a Ray in an SVHandle.

public class RayDisplay : SVHandleDisplay
{
	public override Type ExecutingType
	{
		get { return typeof(Ray); }
	}

	public override void Draw(SVDebugArgs args, ref object value)
	{
		Ray? ray = value as Ray?;

		Handles.ArrowHandleCap(0, ray.Value.origin, Quaternion.LookRotation(ray.Value.direction), 1f, EventType.Repaint);
	}
}

If you need to know more, soon there will be a wiki with all of the information you need!

Installation

To install SVHandles, simply click this link to download the DLL, and put it in your unity project. You can also clone the entire repository if you would like to further customize the extension.

Side-Note

If you do decide to extend SVHandles, it would be greatly appreciated if you could copy your display code into a PullRequest to make things better for everyone, I'm only one person, so I can't think of everything! (Same goes for posting issues if you see something wrong, we're all here to improve.)

About

SceneViewHandles is a lightweight extension which allows you to view and edit variables by only adding one attribute.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages