Skip to content

Commit

Permalink
Merge pull request #881 from ousttrue/fix10/scroll_springBoneWindow
Browse files Browse the repository at this point in the history
SpringBoneWindow が見切れるのを修正。初期選択も実装
  • Loading branch information
ousttrue authored Apr 16, 2021
2 parents ecd9568 + 4e486eb commit 885d814
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ namespace UniVRM10
/// </summary>
public class VRM10SpringSelectorWindow : EditorWindow
{
const string MENU_KEY = VRMVersion.MENU + "/SpringBone";
const string MENU_KEY = VRMVersion.MENU + "/SpringBone Window";

[MenuItem(MENU_KEY, false, 0)]
private static void ExportFromMenu()
{
var window = (VRM10SpringSelectorWindow)GetWindow(typeof(VRM10SpringSelectorWindow));
window.titleContent = new GUIContent("SpringBone selector");
window.Show();
window.Root = Selection.activeTransform;
}

void OnEnable()
Expand Down Expand Up @@ -70,6 +71,8 @@ void Reload()
Root = backup;
}

Vector2 m_scrollPosition;

private void OnGUI()
{
Root = (Transform)EditorGUILayout.ObjectField("vrm1 root", m_root, typeof(Transform), true);
Expand All @@ -79,6 +82,13 @@ private void OnGUI()
Reload();
}

m_scrollPosition = EditorGUILayout.BeginScrollView(m_scrollPosition);
DrawContent();
EditorGUILayout.EndScrollView();
}

void DrawContent()
{
GUI.enabled = false;
s_foldSprings = EditorGUILayout.Foldout(s_foldSprings, "springs");
if (s_foldSprings)
Expand Down

0 comments on commit 885d814

Please sign in to comment.