update CCK to 3.10, fixing unity 2021 crash :)
This commit is contained in:
parent
48a978fa2a
commit
d11e0fb3a9
492 changed files with 2165204 additions and 437687 deletions
30
Assets/ABI.CCK/Scripts/Editor/GUIExtensions/GenericMenuBuilder.cs
Executable file
30
Assets/ABI.CCK/Scripts/Editor/GUIExtensions/GenericMenuBuilder.cs
Executable file
|
@ -0,0 +1,30 @@
|
|||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ABI.CCK.Scripts.Editor
|
||||
{
|
||||
public class GenericMenuBuilder
|
||||
{
|
||||
private readonly GenericMenu _menu = new GenericMenu();
|
||||
|
||||
public void AddMenuItem(string itemName, bool condition, GenericMenu.MenuFunction callback)
|
||||
{
|
||||
if (condition)
|
||||
_menu.AddItem(new GUIContent(itemName), false, callback);
|
||||
else
|
||||
_menu.AddDisabledItem(new GUIContent(itemName));
|
||||
}
|
||||
|
||||
public void AddSeparator(string path = "")
|
||||
{
|
||||
_menu.AddSeparator(path);
|
||||
}
|
||||
|
||||
public void DropDown(Rect position)
|
||||
{
|
||||
_menu.DropDown(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue