mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-11 00:52:19 +00:00
d7c0c06698
* refactoring
38 lines
893 B
C#
38 lines
893 B
C#
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
namespace QSB
|
|
{
|
|
public abstract class QSBBehaviour : MonoBehaviour
|
|
{
|
|
protected bool IsPlayerAwake;
|
|
|
|
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()
|
|
{
|
|
IsPlayerAwake = true;
|
|
}
|
|
|
|
protected virtual void StartSolarSystem() { }
|
|
|
|
protected virtual void StartEyeOfUniverse() { }
|
|
}
|
|
}
|