mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 18:35:34 +00:00
38 lines
886 B
C#
38 lines
886 B
C#
|
using UnityEngine;
|
|||
|
using UnityEngine.SceneManagement;
|
|||
|
|
|||
|
namespace QSB
|
|||
|
{
|
|||
|
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() { }
|
|||
|
}
|
|||
|
}
|