You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/3rd/D2D_Scripts/Databases/Editor/GameProgressionDatabaseEdit...

29 lines
847 B
C#

2 months ago
using D2D.Utilities;
using UnityEditor;
using UnityEngine;
namespace D2D.Databases
{
[CustomEditor(typeof(GameProgressionDatabase))]
public class GameProgressionDatabaseEditor : SuperEditor
{
public override void OnInspectorGUI()
{
var db = (GameProgressionDatabase) target;
if (Application.isPlaying)
{
BeginReadOnly();
EditorGUILayout.FloatField("Player money", db.Money.Value);
EditorGUILayout.IntField("Last scene number", db.LastSceneNumber.Value);
EditorGUILayout.IntField("Passed levels", db.PassedLevels.Value);
EndReadOnly();
}
else
{
if (Button("Clear"))
GameProgressionDatabase.Clear();
}
}
}
}