UnityEngine.GUILayout.Space(float)

Here are the examples of the csharp api UnityEngine.GUILayout.Space(float) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1005 Examples 7

19 View Source File : GameConsole.cs
License : GNU Lesser General Public License v2.1
Project Creator : Ziden

void DrawToolbar()
        {
            GUILayout.BeginHorizontal();

            if (GUILayout.Button(clearLabel))
            {
                logs.Clear();
            }

            foreach (LogType logType in Enum.GetValues(typeof(LogType)))
            {
                var currentState = logTypeFilters[logType];
                var label = logType.ToString();
                logTypeFilters[logType] = GUILayout.Toggle(currentState, label, GUILayout.ExpandWidth(false));
                GUILayout.Space(20);
            }

            isCollapsed = GUILayout.Toggle(isCollapsed, collapseLabel, GUILayout.ExpandWidth(false));

            GUILayout.EndHorizontal();
        }

19 View Source File : GUISkinEditor.cs
License : MIT License
Project Creator : zios

public override void OnInspectorGUI(){
			if(UnityEvent.current.type.MatchesAny("mouseMove") || Utility.IsBusy()){return;}
			EditorUI.ResetFieldSize();
			EditorUI.ResetLayout();
			this.hash = this.hash ?? Utility.GetInspector(this).GetInstanceID().ToString();
			this.skin = this.skin ?? this.target.As<GUISkin>();
			this.isFragment = this.skin.name.Contains("#");
			//this.optimize = Utility.GetPref<bool>("GUISkinEditor-Optimize",false);
			EditorUI.foldoutChanged = false;
			this.DrawViewMode();
			if(this.viewMode == 0){
				this.DrawDefaultInspector();
				return;
			}
			if(!UnityEvent.current.type.MatchesAny("Repaint","Layout","scrollWheel","used")){
				Utility.RecordObject(this.skin,"GUI Skin Changes");
				foreach(var fragment in this.fragments){
					Utility.RecordObject(fragment,"GUI Skin Changes");
				}
			}
			GUI.changed = false;
			this.drawn = false;
			this.count = 0;
			this.fragments = FileManager.Getreplacedets<GUISkin>(this.skin.name+"#*.guiSkin",false);
			this.ProcessMenu();
			this.DrawSearch();
			//this.DrawSplit();
			if(this.inputMode == 0 && this.inputTerms.Count == 0 || this.inputTerms[0] == "Search"){
				this.DrawStandard();
				this.DrawCustom();
				this.DrawFragmented();
			}
			this.CheckChanges();
			this.CheckReset();
			GUILayout.Space(this.lowerBounds);
		}

19 View Source File : GUISkinEditor.cs
License : MIT License
Project Creator : zios

public void DrawFragmented(){
			if(this.fragments.Length > 0){
				GUILayout.Space(10);
				if("Fragments".ToLabel().DrawHeader("GUISkin-Fragments-"+this.hash,GUI.skin.GetStyle("LargeButton").FixedHeight(30))){
					GUILayout.Space(5);
					foreach(var fragment in fragments){
						EditorGUI.indentLevel += 1;
						var fragmentName = fragment.name.Split("#")[1];
						if(fragmentName.ToLabel().DrawFoldout("GUISkin-"+this.hash+"-"+fragment.name)){
							this.DrawStyles(fragmentName+"-"+this.hash,fragment.customStyles);
						}
						EditorGUI.indentLevel -= 1;
					}
				}
			}
		}

19 View Source File : GUISkinEditor.cs
License : MIT License
Project Creator : zios

public bool CheckBounds(GUIStyle style){
			if(!this.optimize || this.rebuild){return true;}
			if((this.count < this.visibleStart) || (this.count > this.visibleEnd)){
				return false;
			}
			if(!this.drawn){
				GUILayout.Space(this.upperBounds);
				this.drawn = true;
			}
			return true;
		}

19 View Source File : GUISkinEditor.cs
License : MIT License
Project Creator : zios

public static void Draw(this GUIStyle current,string key,bool compact=false,bool grouped=false,bool headers=false){
			EditorGUILayout.BeginVertical();
			var styleKey = key + "." + current.name;
			var styleFoldout = current.name.ToLabel().DrawFoldout(styleKey);
			if(styleFoldout){
				var labelWidth = compact ? 140 : 0;
				EditorGUI.indentLevel += 1;
				EditorUI.SetFieldSize(-1,labelWidth,false);
				current.name = current.name.Draw("Name".ToLabel());
				Utility.SetPref<bool>(key+"."+current.name,true);
				if(compact && headers){
					EditorGUILayout.BeginHorizontal();
					GUILayout.Space(140);
					EditorUI.SetLayout(120);
					"Text".ToLabel().DrawLabel(EditorStyles.boldLabel,false);
					"Background".ToLabel().DrawLabel(EditorStyles.boldLabel,false);
					EditorGUILayout.EndHorizontal();
				}
				foreach(var state in current.GetNamedStates()){
					state.Value.Draw(state.Key,compact,styleKey+"."+state.Key);
				}
				current.border.Draw("Border",compact,key+".Border");
				current.margin.Draw("Margin",compact,key+".Margin");
				current.padding.Draw("Padding",compact,key+".Padding");
				current.overflow.Draw("Overflow",compact,key+".Overflow");
				if(!grouped || "Text".ToreplacedleCase().ToLabel().DrawFoldout(key+"Text")){
					current.DrawTextSettings(compact);
				}
				if(!grouped || "Position & Size".ToreplacedleCase().ToLabel().DrawFoldout(key+"Area")){
					current.imagePosition = current.imagePosition.Draw("Image Position").As<ImagePosition>();
					current.contentOffset = current.contentOffset.DrawVector2("Content Offset");
					current.fixedWidth = current.fixedWidth.Draw("Fixed Width");
					current.fixedHeight = current.fixedHeight.Draw("Fixed Height");
					current.stretchWidth = current.stretchWidth.Draw("Stretch Width");
					current.stretchHeight = current.stretchHeight.Draw("Stretch Height");
				}
				EditorUI.ResetFieldSize();
				EditorGUI.indentLevel -= 1;
			}
			EditorGUILayout.EndVertical();
		}

See More Examples