unity3d ~黑科技~ 绘制一个原生风格的搜索框

图片描述

public static string SearchField(string value, params GUILayoutOption[] options)
    {
        MethodInfo info = typeof(EditorGUILayout).GetMethod("ToolbarSearchField", BindingFlags.NonPublic | BindingFlags.Static, null, new System.Type[] { typeof(string), typeof(GUILayoutOption[]) }, null);
        if (info != null)
        {
            value = (string)info.Invoke(null, new object[] { value, options });
        }
        return value;
    }
相关文章
相关标签/搜索