/// <summary> /// Inspector上のGUI描画処理を行います /// </summary> public override void OnInspectorGUI() { // GUIの有効化 GUI.enabled = !EditorApplication.isPlaying; pmdPrefab = (GameObject)EditorGUILayout.ObjectField("PMD Prefab", pmdPrefab, typeof(Object), false); vmd_config.OnGUIFunction(); // Convertボタン EditorGUILayout.Space(); if (message.Length != 0) { GUILayout.Label(message); } else { bool gui_enabled_old = GUI.enabled; GUI.enabled = (null != pmdPrefab); if (GUILayout.Button("Convert")) { if (null == motion_agent) { var obj = (VMDScriptableObject)target; motion_agent = new MotionAgent(obj.assetPath); } motion_agent.CreateAnimationClip(pmdPrefab , vmd_config.createAnimationFile , vmd_config.interpolationQuality ); message = "Loading done."; } GUI.enabled = gui_enabled_old; } GUILayout.Space(40); // モデル情報 if (motion_agent == null) { return; } EditorGUILayout.LabelField("Model Name"); EditorGUILayout.LabelField(motion_agent.model_name, EditorStyles.textField); }
void OnGUI() { // GUIの有効化 GUI.enabled = !EditorApplication.isPlaying; // GUI描画 pmdPrefab = (GameObject)EditorGUILayout.ObjectField("PMD Prefab", pmdPrefab, typeof(GameObject), false); vmdFile = EditorGUILayout.ObjectField("VMD File", vmdFile, typeof(Object), false); vmd_config.OnGUIFunction(); { bool gui_enabled_old = GUI.enabled; GUI.enabled = !EditorApplication.isPlaying && (pmdPrefab != null) && (vmdFile != null); if (GUILayout.Button("Convert")) { LoadMotion(); vmdFile = null; } GUI.enabled = gui_enabled_old; } }