GUILayout

旧的 UI 系统工具,现在用于游戏中的快速简单的原型设计或调试。

void OnGUI ()
{
    GUILayout.Label ("I'm a simple label text displayed in game.");

    if ( GUILayout.Button("CLICK ME") )
    {
        GUILayout.TextArea ("This is a \n
                             multiline comment.")
    }
}

GUILayout 函数在 OnGUI 函数内部工作。