LoginSignup
4
2

More than 5 years have passed since last update.

Editor拡張 最も簡単なScrollView

Posted at

Assets - Editorフォルダ以下に配置します。

using UnityEngine;
using UnityEditor;
using System.Collections;

public class Test : EditorWindow
{
    Vector2 scrollPosition = new Vector2(0, 0);

    [MenuItem("Window/Test")]
    static void ShowWindow()
    {
        var window = EditorWindow.GetWindow(typeof(Test));
        window.Show();
    }

    void OnGUI ()
    {
        scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);

        for (int i = 0; i < 10; i++)
        {
            GUILayout.Label("HogeHoge");
        }

        EditorGUILayout.EndScrollView();
    }
}

scrollView.PNG

小さくすると自動的にスクロールバーがでます。

scrollView1.PNG

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2