Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

vlab22/unityevent-reordering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

12 Commits

Repository files navigation

unityevent-reordering

A simple editor extension to enable unityevent reordering (draggable) feature. I don't know why it is not a default setting.

Tested with Unity 2020年3月5日f1

Just put the code inside an Editor folder

using UnityEditor;
using UnityEditorInternal;
using UnityEngine.Events;
[CustomPropertyDrawer(typeof(UnityEventBase), true)]
public class ReorderingUnityEventDrawer : UnityEventDrawer
{
 protected override void SetupReorderableList(ReorderableList list)
 {
 base.SetupReorderableList(list);
 list.draggable = true;
 }
}

Warning

Don't rely on the execution order of the events, use it only for "organization" purposes.
In your project, the execution order will probably work, but when you or a teammate import/reimport your project, the results could be different.
The list will be orderer but the execution could not.

I'll not explain here but you can search for UnityEvents C# delegates order and get good explanations.

About

A simple editor extension to enable unityevent reordering (draggable) feature

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /