Home

Awesome

Unity Event Drawer Extension <!-- omit in toc -->


PRs Welcome

<< 📝 Description | 📌 Key Features | ⚙ Installation | 🚀 Getting Started | 🤝 Contributing >>

📝 Description <!-- omit in toc -->

image

This package extends the UnityEventDrawer to display runtime calls in the inspector.

What is "runtime calls"?

Button.onClick and Toggle.OnChangeValue etc. are known as UnityEvent.
UnityEvent has two types of callbacks:

Display your runtime calls

This package extends UnityEventDrawer to display runtime calls in the inspector.
If the runtime call is an instance method, its target is also displayed.
This plugin supports all events that inherit UnityEvent<T0> - UnityEvent<T0, T1, T2, T3> as well as UnityEvent.
Even if the persistent call is empty, UnityEvent is displayed compactly in the inspector.

public class TestBehavior : MonoBehaviour
{
	[System.Serializable] public class TransformUnityEvent : UnityEngine.Events.UnityEvent<Transform>{};

	[SerializeField] TransformUnityEvent onYourCustomEvent = new TransformUnityEvent();
	
	void OnEnable()
	{
		onYourCustomEvent.AddListener(TestTransform);
	}
	
	void TestTransform(Transform t)
	{
		Debug.Log("TestTransform has called : " + t);
	}
}

image

If you like a style of development that makes heavy use of runtime calls (MVP pattern, etc.), this package is for you!

<br><br>

<br><br>

📌 Key Features

<br><br>

⚙ Installation

Install via OpenUPM

Install via UPM (with Package Manager UI)

Install via UPM (Manually)

Install as Embedded Package

  1. Download a source code zip file from Releases and extract it.
  2. Place it in your project's Packages directory.

<br><br>

🚀 Getting Started

  1. Install the package.

  2. Add a runtime call, such as Button.onClick.AddListener (method).

  3. Information about the runtime call is displayed in the inspector.
    image

  4. Enjoy!

<br><br>

🤝 Contributing

Issues

Issues are incredibly valuable to this project:

Pull Requests

Pull requests offer a fantastic way to contribute your ideas to this repository.
Please refer to CONTRIBUTING.md and develop branch for guidelines.

Support

This is an open-source project developed during my spare time.
If you appreciate it, consider supporting me.
Your support allows me to dedicate more time to development. 😊


<br><br>

License

Author

See Also