private static void CreateTMP(MenuCommand menuCommand) { TMPro_CreateObjectMenu.AddButton(menuCommand); var obj = Selection.activeGameObject; CustomComponentEditor.ReplaceComponent(obj); }
private static void CreateText(MenuCommand menuCommand) { var menuOptions = typeof(MaskEditor).Assembly.GetType("UnityEditor.UI.MenuOptions"); var createBtn = menuOptions.GetMethod("AddText", BindingFlags.Static | BindingFlags.Public); createBtn.Invoke(null, new object[] { menuCommand }); var obj = Selection.activeGameObject; CustomComponentEditor.ReplaceComponent(obj); }
private static void CreateTextTMP(MenuCommand menuCommand) { var method = typeof(TMPro_CreateObjectMenu).GetMethod("CreateTextMeshProGuiObjectPerform", BindingFlags.Static | BindingFlags.NonPublic); method.Invoke(null, new object[] { menuCommand }); var obj = Selection.activeGameObject; CustomComponentEditor.ReplaceComponent(obj); }