2021-02-12 10:32:10 +01:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
[System.Serializable]
|
|
|
|
public enum SceneType
|
|
|
|
{
|
|
|
|
None,
|
|
|
|
|
|
|
|
BootSequence,
|
|
|
|
MainMenu,
|
|
|
|
Gameplay,
|
|
|
|
Credits,
|
|
|
|
|
|
|
|
COUNT
|
|
|
|
}
|
|
|
|
|
|
|
|
public abstract class SceneLoader : MonoBehaviour
|
|
|
|
{
|
|
|
|
[SerializeField]
|
|
|
|
private SceneType _sceneType;
|
|
|
|
|
|
|
|
private SceneType _toLoad = SceneType.None;
|
|
|
|
|
|
|
|
public SceneType SceneType => _sceneType;
|
|
|
|
|
|
|
|
public SceneType ToLoad => _toLoad;
|
|
|
|
|
|
|
|
public abstract void StartLoad();
|
|
|
|
public abstract bool LoadComplete { get; }
|
|
|
|
|
|
|
|
public void LoadScene( SceneType scene )
|
|
|
|
{
|
|
|
|
if ( scene == SceneType.COUNT || scene == SceneType.None )
|
|
|
|
{
|
|
|
|
Debug.LogError($"cannot load scene {scene}");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
_toLoad = scene;
|
|
|
|
}
|
2021-03-08 18:05:33 +01:00
|
|
|
|
|
|
|
public void Quit()
|
|
|
|
{
|
|
|
|
Application.Quit();
|
|
|
|
}
|
2021-02-12 10:32:10 +01:00
|
|
|
}
|