I made an editor extension to easily inspect any field, property, method or animator parameter on any UnityEngine.Object. It works really similarly to UnityEvents, and it has relatively the same purpose: fast prototyping and easy decoupling.
Here’s how it looks:
And a simple example code with the setup in the screenshot, that will print the linked variable and method result:
using UnityEngine;
using UnityEngine.Reflection;
public class BasicExample : MonoBehaviour
{
public UnityMethod method;
public UnityVariable variable;
void Start()
{
Debug.LogFormat("Method return: {0}", method.Invoke());
Debug.LogFormat("Variable value: {0}", variable.Get());
}
}
Features:
- Inspect fields, properties and methods
- Inspect animator parameters
- Serialized for persistency across reloads
- Works on GameObjects and ScriptableObjects
- Multi-object editing
- Undo / Redo support
- Looks and feels like a built-in Unity component
Limitations:
- Doesn’t support method overloading (yet)
Installation & License:
It’s a simple folder you can import in your project. It’s MIT licensed, so you can safely use it for free in your projects, even commercial games or assets.
Link:
The repository is hosted on GitHub here: GitHub - lazlo-bonin/ludiq-reflection: A set of Unity classes and their inspector drawers that provide easy reflection and decoupling.
Let me know what you think!