https://github.com/abbgrade/propertyinspector
PropertyInspector for Unity displays the values of properties in a default inspector.
https://github.com/abbgrade/propertyinspector
Last synced: 3 months ago
JSON representation
PropertyInspector for Unity displays the values of properties in a default inspector.
- Host: GitHub
- URL: https://github.com/abbgrade/propertyinspector
- Owner: abbgrade
- License: mit
- Created: 2014-11-20T12:22:49.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-25T08:22:10.000Z (over 11 years ago)
- Last Synced: 2024-05-02T00:46:26.312Z (about 2 years ago)
- Language: C#
- Size: 137 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: License.md
Awesome Lists containing this project
README
# Property Inspector
*PropertyInspector* is a improved *DefaultInspector* for the [*Unity3d* game engine](http://unity3d.com). It's tested with *Unity 4* and may work with older versions.
For debug purposes you may want to view the values of properties and unserialized fields of your *MonoBehaviors*. With the *PropertyInspector* this is very easy.
## License
This is free software and it is provided under MIT license that is distributed with this package.
## Contribution & Support
If you have a question or contribution to the *PropertyInspector* visit our [GitHub Project](https://github.com/abbgrade/PropertyInspector).
To build the readme on *Windows* and *VisualStudio* you have to install [Pandoc](johnmacfarlane.net/pandoc) and [MiKTeX](http://miktex.org/).
## Installation
### From Unitypackage
Select in the Menu "Assets/Import Package/Custom Package"
Select your local copy of "PropertyInspector.unitypackage"
### From GitHub
Download the [sources](https://github.com/abbgrade/PropertyInspector/archive/master.zip) from *Github*.
Unpack *Editor.cs* *ShowInInspector.cs* to your projects *Assets* directory.
## Usage
### Show Properties in the Inspector
Just add the attribute *ShowInInspector* to the property which should be displayed.
Note that the getter must be public.
#### Example
[ShowInInspector]
public Vector3 GlobalPosition
{
Get { return this.transform.position; }
}
### Custom Inspectors
Instead of inherit from *UnityEditor.Editor* inherit from *PropertyInspector.Editor*.
Don't forget to call *base.OnInspectorGUI* if you override *OnInspectorGUI*.
#### Example
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(CustomBehavior))]
public class CustomInspector : PropertyInspector.Editor
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
if (GUILayout.Button("Do Fun"))
{
Debug.Log("Fun");
}
}
}