Делает пробел в текущей группе.
Направление пробела зависит от компоновки группы. Если группа вертикальная, то и пробел будет вертикальным:
Важно: Это будет переопределять GUILayout.ExpandWidth и GUILayout.ExpandHeight
"Пробел в 20px между двумя кнопками".
function OnGUI () {
GUILayout.Button ("I'm the first button");
// Insert 20 pixels of space between the 2 buttons.
GUILayout.Space (20);
GUILayout.Button ("I'm a bit further down");
}
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { void OnGUI() { GUILayout.Button("I'm the first button"); GUILayout.Space(20); GUILayout.Button("I'm a bit further down"); } }
В горизонтальных группах пиксели измеряются горизонтально:
function OnGUI () {
GUILayout.BeginHorizontal();
GUILayout.Button ("I'm the first button");
// Insert 20 pixels of space between the 2 buttons.
GUILayout.Space (20);
GUILayout.Button ("I'm the second button");
GUILayout.EndHorizontal();
}
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { void OnGUI() { GUILayout.BeginHorizontal(); GUILayout.Button("I'm the first button"); GUILayout.Space(20); GUILayout.Button("I'm the second button"); GUILayout.EndHorizontal(); } }