mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-11 13:04:17 -05:00
Vrm10TopMenu に MenuItem を集約
This commit is contained in:
parent
7207629094
commit
e22bacb94e
|
|
@ -10,11 +10,8 @@ namespace UniVRM10
|
|||
/// </summary>
|
||||
public class VRM10Window : EditorWindow
|
||||
{
|
||||
const string MENU_KEY = VRMVersion.MENU + "/VRM1 Window";
|
||||
const string WINDOW_TITLE = "VRM1 Window";
|
||||
|
||||
[MenuItem(MENU_KEY, false, 1)]
|
||||
private static void ExportFromMenu()
|
||||
public static void Open()
|
||||
{
|
||||
var window = (VRM10Window)GetWindow(typeof(VRM10Window));
|
||||
window.titleContent = new GUIContent(WINDOW_TITLE);
|
||||
|
|
|
|||
|
|
@ -13,22 +13,8 @@ namespace UniVRM10
|
|||
/// は SubModuleになった。 `$ git submodule update --init` しておくこと。
|
||||
///
|
||||
/// </summary>
|
||||
public static class Menu
|
||||
public static class GeneratorMenu
|
||||
{
|
||||
#if VRM_DEVELOP
|
||||
[MenuItem(UniVRM10.VRMVersion.MENU + "/Generate from JsonSchema")]
|
||||
public static void Generate()
|
||||
{
|
||||
Run(false);
|
||||
}
|
||||
|
||||
[MenuItem(UniVRM10.VRMVersion.MENU + "/Generate from JsonSchema(debug)")]
|
||||
public static void Parse()
|
||||
{
|
||||
Run(true);
|
||||
}
|
||||
#endif
|
||||
|
||||
struct GenerateInfo
|
||||
{
|
||||
public string JsonSchema;
|
||||
|
|
@ -49,7 +35,7 @@ namespace UniVRM10
|
|||
|
||||
const string SPEC_DIR = "vrm-specification/specification";
|
||||
|
||||
static void Run(bool debug)
|
||||
public static void Run(bool debug)
|
||||
{
|
||||
var projectRoot = new DirectoryInfo(Path.GetFullPath(Path.Combine(Application.dataPath, "../")));
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,7 @@ namespace UniVRM10
|
|||
{
|
||||
public class VRM10ExportDialog : ExportDialogBase
|
||||
{
|
||||
const string CONVERT_HUMANOID_KEY = VRMVersion.MENU + "/Export VRM-1.0";
|
||||
|
||||
[MenuItem(CONVERT_HUMANOID_KEY, false, 0)]
|
||||
private static void ExportFromMenu()
|
||||
public static void Open()
|
||||
{
|
||||
var window = (VRM10ExportDialog)GetWindow(typeof(VRM10ExportDialog));
|
||||
window.titleContent = new GUIContent("VRM-1.0 Exporter");
|
||||
|
|
|
|||
25
Assets/VRM10/Editor/Vrm10TopMenu.cs
Normal file
25
Assets/VRM10/Editor/Vrm10TopMenu.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using UnityEditor;
|
||||
|
||||
namespace UniVRM10
|
||||
{
|
||||
public static class Vrm10TopMenu
|
||||
{
|
||||
private const string UserMenuPrefix = VRMVersion.MENU;
|
||||
private const string DevelopmentMenuPrefix = VRMVersion.MENU + "/Development";
|
||||
|
||||
const string CONVERT_HUMANOID_KEY = VRMVersion.MENU + "/Export VRM-1.0";
|
||||
[MenuItem(UserMenuPrefix + "/Export VRM-1.0", priority = 1)]
|
||||
static void OpenExportDialog() => VRM10ExportDialog.Open();
|
||||
|
||||
#if VRM_DEVELOP
|
||||
[MenuItem(UserMenuPrefix + "/VRM1 Window", false, 2)]
|
||||
static void OpenWindow() => VRM10Window.Open();
|
||||
|
||||
[MenuItem(DevelopmentMenuPrefix + "/Generate from JsonSchema")]
|
||||
public static void Generate() => GeneratorMenu.Run(false);
|
||||
|
||||
[MenuItem(DevelopmentMenuPrefix + "/Generate from JsonSchema(debug)")]
|
||||
public static void Parse() => GeneratorMenu.Run(true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
11
Assets/VRM10/Editor/Vrm10TopMenu.cs.meta
Normal file
11
Assets/VRM10/Editor/Vrm10TopMenu.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 935fd2eb9940f5d48933733f69a96113
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in New Issue
Block a user