This plugin extends the UnityEventDrawer to display runtime calls in the inspector.
<< Description | Download | Usage | Development Note >>
Button.onClick and Toggle.OnChangeValue etc. are known as UnityEvent.
UnityEvent has two types of callbacks:
- Persistent call
- Runtime call
This plugin extends UnityEventDrawer to display runtime calls in inspector.
If 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.
Also, when the Persistent call is empty, UnityEvent is displayed compactly in 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);
}
}
If you like a development style that heavily uses Runtime calls (MVP pattern, etc.), we recommend using this plugin!
- Displays runtime calls in inspector
- Expands/collapses the runtime call view
- Displays instance method, its target is also displayed
- When the Persistent call is empty, displays it compactly
- Supports pro skin
- Supports all components as well as uGUI components such as
Button
andToggle
- Supports
EventTrigger
- Download UnityEventDrawerEx.unitypackage from Releases.
- Import the package into your Unity project. Select
Import Package > Custom Package
from theAssets
menu. - Add a runtime call, such as
Button.onClick.AddListener (method)
. - Information about the runtime call is displayed in inspector.
- Enjoy!
- Unity 5.5+ (included Unity 2018.x)
- No other SDK are required
- MIT
- © UTJ/UCL
- GitHub page : https://github.com/mob-sakai/UnityEventDrawerEx
- Releases : https://github.com/mob-sakai/UnityEventDrawerEx/releases
- Issue tracker : https://github.com/mob-sakai/UnityEventDrawerEx/issues
- Current project : https://github.com/mob-sakai/UnityEventDrawerEx/projects/1
- Change log : https://github.com/mob-sakai/UnityEventDrawerEx/blob/master/CHANGELOG.md