以下の内容はhttps://baba-s.hatenablog.com/entry/2019/09/24/160000より取得しました。


【Unity】選択中のファイルの数を常に表示するエディタ拡張

ソースコード

using UnityEditor;
using UnityEngine;

public sealed class SelectedFilesCountWindow : EditorWindow
{
    private int m_count;

    [MenuItem( "Window/Selected Files Count" )]
    private static void Init()
    {
        var win = GetWindow<SelectedFilesCountWindow>( "Selected Files" );
        win.minSize = new Vector2( 32, 16 );
    }

    private void OnEnable()
    {
        Selection.selectionChanged += OnChanged;
    }

    private void OnDisable()
    {
        Selection.selectionChanged -= OnChanged;
    }

    private void OnChanged()
    {
        m_count = Selection.objects.Length;
        Repaint();
    }

    private void OnGUI()
    {
        GUILayout.Label( $"Selected Files: {m_count.ToString()}" );
    }
}

使い方

f:id:baba_s:20190921152701p:plain

Unity メニューの「Window > Selected Files Count」を選択すると

f:id:baba_s:20190921152703p:plain

選択中のファイルを常に表示するウィンドウを表示できます




以上の内容はhttps://baba-s.hatenablog.com/entry/2019/09/24/160000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14