mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-06 01:00:16 +00:00
fixed respawnondeath
This commit is contained in:
parent
9677ab3928
commit
d2c8ba5d11
@ -28,21 +28,7 @@ namespace QSB.DeathSync
|
||||
private ShipCockpitController _cockpitController;
|
||||
private PlayerSpacesuit _spaceSuit;
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
|
||||
QSBCore.Helper.Events.Subscribe<PlayerResources>(OWML.Common.Events.AfterStart);
|
||||
QSBCore.Helper.Events.Event += OnEvent;
|
||||
}
|
||||
|
||||
private void OnEvent(MonoBehaviour behaviour, OWML.Common.Events ev)
|
||||
{
|
||||
if (behaviour is PlayerResources && ev == OWML.Common.Events.AfterStart)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
}
|
||||
public void Awake() => Instance = this;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
|
@ -180,6 +180,8 @@ namespace QSB
|
||||
gameObject.AddComponent<RespawnOnDeath>();
|
||||
gameObject.AddComponent<PreventShipDestruction>();
|
||||
|
||||
QSBCore.Helper.Events.Unity.RunWhen(() => QSBCore.HasWokenUp, RespawnOnDeath.Instance.Init);
|
||||
|
||||
if (QSBSceneManager.IsInUniverse)
|
||||
{
|
||||
QSBSectorManager.Instance.RebuildSectors();
|
||||
|
Loading…
Reference in New Issue
Block a user