public override void OnGUI() { var rect = EditorGUILayout.BeginHorizontal(); GUILayout.Space(20); EditorGUILayout.BeginVertical(); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(level.name); Color origColor = GUI.color; GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 0.5f); EditorGUILayout.LabelField(level.sceneName); GUI.color = origColor; EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.EndVertical(); Texture texture = textureOther; switch (level.type) { case MadLevel.Type.Other: texture = textureOther; break; case MadLevel.Type.Level: texture = textureLevel; break; case MadLevel.Type.Extra: texture = textureExtra; break; default: Debug.LogError("Unknown level type: " + level.type); break; } if (!level.IsValid()) { texture = textureError; } GUI.DrawTexture(new Rect(rect.x, rect.y, 28, 34), texture); EditorGUILayout.EndHorizontal(); }
public override void OnGUI() { var rect = EditorGUILayout.BeginHorizontal(); GUILayout.Space(45); EditorGUILayout.BeginVertical(); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(level.name); Color origColor = GUI.color; GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 0.5f); EditorGUILayout.LabelField(level.sceneName); GUI.color = origColor; EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.EndVertical(); Texture texture = textureOther; switch (level.type) { case MadLevel.Type.Other: texture = textureOther; break; case MadLevel.Type.Level: texture = textureLevel; break; case MadLevel.Type.Extra: texture = textureExtra; break; default: Debug.LogError("Unknown level type: " + level.type); break; } if (!level.IsValid()) { texture = textureError; } GUI.DrawTexture(new Rect(rect.x, rect.y, 28, 34), texture); if (level.hasExtension) { GUI.DrawTexture(new Rect(rect.x, rect.y, 28, 34), textureStar); } // draw lock if (level.type == MadLevel.Type.Level) { Texture lockTexture = level.lockedByDefault ? textureLock : textureLockUnlocked; GUI.DrawTexture(new Rect(rect.x + 22, rect.y, 28, 34), lockTexture); } EditorGUILayout.EndHorizontal(); }