Unity中实现类似Addressable的Inspector打勾

在这里插入图片描述

using UnityEditor;
using UnityEngine;


[InitializeOnLoad]
public static class MyAATest
{
    
    
    static MyAATest()
    {
    
    
    	//重点!!!
        Editor.finishedDefaultHeaderGUI += OnPostHeaderGUI;
    }

    static bool markable = false;
    static void OnPostHeaderGUI(Editor editor)
    {
    
    
        markable = GUILayout.Toggle(false, new GUIContent("MyAA", "tips"));


        if (!markable) return;
        EditorGUILayout.DropdownButton(new GUIContent("MyAA", "tips"), FocusType.Keyboard);
    }
}

猜你喜欢

转载自blog.csdn.net/qq_46273241/article/details/130586368