Level selector was already working after work by William but some small bugs remained to be fixed + it wasn't possible to return to level selector once we were in the level. - it's now possible to go back to level selector from Level - LevelManagerScript is no longer a singleton (this way, it resets with the Game scene unloading) - Added a property drawer for using scene files in inspectors
22 lines
510 B
C#
22 lines
510 B
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
[CustomEditor(typeof(LevelManagerScript))]
|
|
public class LevelManagerEditor : Editor
|
|
{
|
|
public override void OnInspectorGUI()
|
|
{
|
|
DrawDefaultInspector();
|
|
if (Application.isPlaying)
|
|
{
|
|
if (GUILayout.Button("Save"))
|
|
{
|
|
LevelManager.Instance.SaveFile();
|
|
}
|
|
if (GUILayout.Button("Load"))
|
|
{
|
|
LevelManager.Instance.LoadFile();
|
|
}
|
|
}
|
|
}
|
|
} |