2020-02-18 21:32:26 +01:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.SceneManagement;
|
|
|
|
|
|
|
|
|
|
namespace QSB
|
|
|
|
|
{
|
2020-02-21 23:36:07 +01:00
|
|
|
|
public abstract class QSBBehaviour : MonoBehaviour
|
2020-02-18 21:32:26 +01:00
|
|
|
|
{
|
2020-02-21 23:36:07 +01:00
|
|
|
|
protected bool IsPlayerAwake;
|
2020-02-18 21:32:26 +01:00
|
|
|
|
|
|
|
|
|
protected virtual void Awake()
|
|
|
|
|
{
|
|
|
|
|
GlobalMessenger.AddListener("WakeUp", PlayerWokeUp);
|
|
|
|
|
SceneManager.sceneLoaded += OnSceneLoaded;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
|
|
|
|
{
|
|
|
|
|
if (scene.name == "SolarSystem")
|
|
|
|
|
{
|
|
|
|
|
StartSolarSystem();
|
|
|
|
|
}
|
|
|
|
|
else if (scene.name == "EyeOfTheUniverse")
|
|
|
|
|
{
|
|
|
|
|
StartEyeOfUniverse();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual void PlayerWokeUp()
|
|
|
|
|
{
|
2020-02-21 23:36:07 +01:00
|
|
|
|
IsPlayerAwake = true;
|
2020-02-18 21:32:26 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual void StartSolarSystem() { }
|
|
|
|
|
|
|
|
|
|
protected virtual void StartEyeOfUniverse() { }
|
|
|
|
|
}
|
|
|
|
|
}
|