コード例 #1
0
        private static void CreateTMP(MenuCommand menuCommand)
        {
            TMPro_CreateObjectMenu.AddButton(menuCommand);
            var obj = Selection.activeGameObject;

            CustomComponentEditor.ReplaceComponent(obj);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }