-
Notifications
You must be signed in to change notification settings - Fork 6
Editor
-
QuickStart
-
Get all the
Staticmethods that have ContextMenu attribute when[InitializeOnLoadMethod]called -
Get all the
UnityEngine.Objectmethods that have ContextMenu attribute whenOnEnable()called -
Add these methods to a special list, and then other classes that inherit the
EasyContextMenucan easily call these methods
-
-
ContextMenu Buttons
Quickly add buttons for utility functions to the inspector by using UnityEngine. ContextMenuAttribute
public class ContextMenuTest : MonoBehaviour { public bool isTestEnabled; [ContextMenu("Test Function")] private void MyTestFunction() { Debug.Log("Test function fired"); } [ContextMenu("Test Function", isValidateFunction:true)] private bool TestFunctionValidate() { return isTestEnabled; } [ContextMenu("Other Test")] private void NonValidatedTest() { Debug.Log("Non validated test fired"); } }
-
Right click in Project Window and Select Create -> Custom Script -> ScriptableObject Window


-
You can use search or drop-down menu select a
ScriptableObject(you can found allScriptableObjectin project) -
Click
Create Buttoncreate you selected class as a.assetfile
-
Right click in Project Window and Select Create -> Custom Script -> Template Script Window

-
You can use search or drop-down menu select a
IScriptAssetInstaller(you can found allIScriptAssetInstallerin project) -
Click
Create Buttoncreate you selected template script as a.csfile

The ContextMenu functions you want to called must are Static. You can set the split line by setting the priority value (split line every 50 values). You even can call a method with a parameter and the parameter type must be set as System.Object. The enter parameter is you current selected Object
[ContextMenu ("GameObject/Do Something/NonParam", false, 1)]
static public void DoSomething () { ... }
[ContextMenu ("GameObject/Do Something/NonParam", true, 1)]
static public bool CheckDoSomething () { ... return true; }
[ContextMenu ("GameObject/Do Something/Param", false, 2)]
static public void DoSomething (object activeGameObject) { ... }
The components on the gameObject are missing? This is a very common situation, because programmers need to modified components and can't remember all gameObjects added these components
But we don't want to missing components of the gameObjects exists in the scene. Of course we can code a simple script to remove all missing components. But it's not intuitive, maybe we need know where missing component and use a new component to replace it
Fortunately, UniEasy achieved this feature. You can right click in Hierarchy Window and select UniEasy -> Search for All Missing Components Then click ...
Now all gameObjects that missing components are listed in the Hierarchy Window
Click the Window -> Batch Processing Window button on the menu bar to Open the Batch Processing Window

It can do the following:
-
Order gameObjects and format gameObjects name in Hierarchy
-
Manage render queue of materials in Hierarchy
-
Batch replace gameObjects with prefab
-
Categorize referenced assets
-
Check whether assets be used in somewhere or by something
You can use EnumMaskAttribute to draw a field for enum masks, eg
public enum LoadingScreenLayer
{
Default,
Overlay,
}
public class Example : MonoBehaviour
{
[EnumMask]
public LoadingScreenLayer LoadingMask = (LoadingScreenLayer)(1 << 0);
}
You can use TypePopupAttribute to draw a type popup selection field, eg
public class Example : MonoBehaviour
{
[TypePopup(typeof(AnimatorEvent))]
public string EventType;
}