此插件扩展了 UnityEventDrawer,以在检查器中显示运行时调用。
This package extends the UnityEventDrawer to display runtime calls in the inspector.
Button.onClick and Toggle.OnChangeValue etc. are known as UnityEvent.
UnityEvent has two types of callbacks:
Persistent call
Runtime call
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 - UnityEvent 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{};
[SerializeField] TransformUnityEvent onYourCustomEvent = new TransformUnityEvent();
void OnEnable()
{
onYourCustomEvent.AddListener(TestTransform);
}
void TestTransform(Transform t)
{
Debug.Log("TestTransform has called : " + t);
}
}If you like a style of development that makes heavy use of runtime calls (MVP pattern, etc.), this package is for you!
Displays runtime calls in inspector
Expands/collapses the runtime call view
Displays instance method, its target is also displayed
If the persistent call is empty, displays it compactly
Supports dark skin
Supports all components as well as uGUI components like Button and Toggle
Supports EventTrigger
openupm add com.coffee.event-drawer-exWindow > Package Manager) or run the following command with @{version}:openupm add [email protected]Click Window > Package Manager to open Package Manager UI.
Click + > Add package from git URL... and input the repository URL: https://github.com/mob-sakai/UnityEventDrawerEx.git
To update the package, change suffix #{version} to the target version.
https://github.com/mob-sakai/UnityEventDrawerEx.git#1.1.0Open the Packages/manifest.json file in your project. Then add this package somewhere in the dependencies block:
{
"dependencies": {
"com.coffee.event-drawer-ex": "https://github.com/mob-sakai/UnityEventDrawerEx.git",
...
}
}To update the package, change suffix #{version} to the target version.
"com.coffee.event-drawer-ex": "https://github.com/mob-sakai/UnityEventDrawerEx.git#1.1.0",Packages directory.Add a runtime call, such as Button.onClick.AddListener (method).
Information about the runtime call is displayed in the inspector.
Enjoy!
Issues are incredibly valuable to this project:
Pull requests offer a fantastic way to contribute your ideas to this repository.
Please refer to CONTRIBUTING.md
and develop branch for guidelines.
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.
暂无开放 Issues,或尚未同步最近议题。