void OnGUI() { GUILayout.Label("Block Builder", EditorStyles.boldLabel); pegCount = EditorGUILayout.IntField("Quantity of Pegs", pegCount); height = EditorGUILayout.IntField("Height of Block", height); obj = EditorGUILayout.ObjectField(obj, typeof(GameObject), true); if (GUILayout.Button("Create Block")) { if (blockList != null) { if (obj != null && pegCount > 0) { blockList.CreateBlock((GameObject)obj, pegCount, height); } } else { blockList = new BlockList(); } } if (GUILayout.Button("Peg Count")) { if (blockList != null) { blockList.PegCounter(); } } if (GUILayout.Button("Clear Block List")) { if (blockList != null) { blockList.ClearBlocks(); Debug.Log("All Blocks Cleared"); } } GUILayout.Label("Debug", EditorStyles.miniBoldLabel); if (GUILayout.Toggle(debugger, GUIContent.none)) { debugger = true; } else { debugger = false; } if (blockList != null && debugger) { GUILayout.Label("Quantity Of Blocks In List", EditorStyles.miniBoldLabel); GUILayout.TextArea(blockList.ListBlocks().Count.ToString(), EditorStyles.textArea); } }
/// <summary> /// Debug used for dev of new features coming... /// </summary> private void DebugBuilder() { if (debugger) { GUILayout.Label("Quantity Of Blocks In List", EditorStyles.miniBoldLabel); GUILayout.TextArea(blockList.ListBlocks().Count.ToString(), EditorStyles.helpBox); if (GUILayout.Button("Peg Count")) { if (blockList != null) { blockList.PegCounter(); } } if (GUILayout.Button("Clear Block List")) { if (blockList != null) { i = 0; blockList.ClearBlocks(); UnityEngine.Debug.Log("All Blocks Cleared"); } } } }