mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-13 22:39:39 -05:00
WINDOW_TITLE to VRM1.0 Model Editor
This commit is contained in:
@@ -10,13 +10,15 @@ namespace UniVRM10
|
||||
/// </summary>
|
||||
public class VRM10Window : EditorWindow
|
||||
{
|
||||
const string WINDOW_TITLE = "VRM1 Window";
|
||||
public static void Open()
|
||||
public const string WINDOW_TITLE = "VRM1.0 Model Editor";
|
||||
|
||||
public static VRM10Window Open()
|
||||
{
|
||||
var window = (VRM10Window)GetWindow(typeof(VRM10Window));
|
||||
window.titleContent = new GUIContent(WINDOW_TITLE);
|
||||
window.Show();
|
||||
window.Root = UnityEditor.Selection.activeTransform?.GetComponent<Vrm10Instance>();
|
||||
return window;
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
|
||||
@@ -115,14 +115,8 @@ namespace UniVRM10
|
||||
return loaded;
|
||||
}
|
||||
|
||||
void Setup(Vrm10Instance instance)
|
||||
void SetupVRM10Object(Vrm10Instance instance)
|
||||
{
|
||||
if (instance.Vrm != null)
|
||||
{
|
||||
// OK
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CheckHumanoid(instance.gameObject))
|
||||
{
|
||||
// can not
|
||||
@@ -162,9 +156,22 @@ namespace UniVRM10
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
|
||||
if (target is Vrm10Instance instance)
|
||||
{
|
||||
Setup(instance);
|
||||
if (instance.Vrm == null)
|
||||
{
|
||||
SetupVRM10Object(instance);
|
||||
}
|
||||
|
||||
if (instance.Vrm != null)
|
||||
{
|
||||
EditorGUILayout.HelpBox("SpringBone utility", MessageType.Info);
|
||||
if (GUILayout.Button("Open " + VRM10Window.WINDOW_TITLE))
|
||||
{
|
||||
VRM10Window.Open();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.OnInspectorGUI();
|
||||
|
||||
Reference in New Issue
Block a user