r2mods/ilspy_dump/ror2_csproj/EntityStates.GameOver/VoidEndingStart.cs

40 lines
747 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine;
using UnityEngine.Networking;
namespace EntityStates.GameOver;
public class VoidEndingStart : BaseGameOverControllerState
{
[SerializeField]
public float duration;
private bool hasSceneExited;
public override void FixedUpdate()
{
base.FixedUpdate();
if (NetworkServer.active && base.fixedAge >= duration && hasSceneExited)
{
outer.SetNextState(new VoidEndingFadeToBlack());
}
}
public override void OnEnter()
{
base.OnEnter();
SceneExitController.onFinishExit += OnFinishSceneExit;
}
public override void OnExit()
{
SceneExitController.onFinishExit -= OnFinishSceneExit;
base.OnExit();
}
private void OnFinishSceneExit(SceneExitController obj)
{
hasSceneExited = true;
}
}