public static void DrawListElement(Rect rect, AutoSpawner listEntry, ref bool changesMade) { int oldIndent = EditorGUI.indentLevel; EditorGUI.indentLevel = 0; //EditorGUI.LabelField(new Rect(rect.x, rect.y, rect.width * 0.1f, EditorGUIUtility.singleLineHeight), m_editorUtils.GetContent("AutoSpawnerActive")); EditorGUI.BeginChangeCheck(); listEntry.isActive = EditorGUI.Toggle(new Rect(rect.x, rect.y, 20, EditorGUIUtility.singleLineHeight), listEntry.isActive); //switch (listEntry.status) //{ // case AutoSpawnerStatus.Spawning: // EditorGUI.LabelField(new Rect(rect.x + rect.width * 0.2f, rect.y, rect.width * 0.2f, EditorGUIUtility.singleLineHeight), String.Format("{0:f0}", listEntry.spawner.m_spawnProgress * 100)); // break; // default: // EditorGUI.LabelField(new Rect(rect.x + rect.width * 0.2f, rect.y, rect.width * 0.2f, EditorGUIUtility.singleLineHeight), listEntry.status.ToString()); // break; //} bool currentGUIState = GUI.enabled; GUI.enabled = listEntry.isActive; listEntry.spawner = (Spawner)EditorGUI.ObjectField(new Rect(rect.x + 20, rect.y, rect.width - 20, EditorGUIUtility.singleLineHeight), listEntry.spawner, typeof(Spawner), true); if (EditorGUI.EndChangeCheck()) { changesMade = true; } GUI.enabled = currentGUIState; EditorGUI.indentLevel = oldIndent; }
void Awake() { Instance = this; }
void Awake() { spawner = autoSpawner.GetComponent <AutoSpawner>(); }