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;
    }

你可能感兴趣的:(迷途吧的编辑器魔法)