Пример #1
0
    private void PlaceButton(DrawComponentFuncPtr funcPtr, bool enabled)
    {
        bool previous = GUI.enabled;

        GUI.enabled = enabled;

        funcPtr();

        GUI.enabled = previous;
    }
Пример #2
0
    private void PlaceFrame(string frameLabel, DrawComponentFuncPtr fnPtr)
    {
        using (new GUILayout.VerticalScope()) {
            GUIStyle style = new GUIStyle(EditorStyles.boldLabel);
            style.fontStyle = FontStyle.Bold;
            GUILayout.Label(frameLabel, style);

            using (new GUILayout.HorizontalScope("helpbox")) {
                GUILayout.Space(5);     // Left Padding
                fnPtr();
                GUILayout.Space(12);    // Right Padding
            }
        }
    }
Пример #3
0
    private void Btn(string label, Texture2D img, GUILayoutOption w, GUILayoutOption h, DrawComponentFuncPtr DrawButton_funcPtr)
    {
        using (new GUILayout.VerticalScope()) {
            GUILayout.Space(5);     // Left Padding
            if (GUILayout.Button(img, w, h))
            {
                DrawButton_funcPtr();
            }

            // Draw Label
            GUILayout.Label(label, buttonLabelStyle);
        }
    }