r2mods/ilspy_dump/ror2_csproj/EntityStates.GameOver/RoR2MainEndingSetSceneAndWa...

37 lines
832 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine.Networking;
namespace EntityStates.GameOver;
public class RoR2MainEndingSetSceneAndWaitForPlayers : BaseGameOverControllerState
{
private SceneDef desiredSceneDef;
public override void OnEnter()
{
base.OnEnter();
FadeToBlackManager.ForceFullBlack();
FadeToBlackManager.fadeCount++;
desiredSceneDef = SceneCatalog.GetSceneDefFromSceneName("outro");
if (NetworkServer.active)
{
Run.instance.AdvanceStage(desiredSceneDef);
}
}
public override void FixedUpdate()
{
base.FixedUpdate();
if (NetworkServer.active && NetworkUser.AllParticipatingNetworkUsersReady() && SceneCatalog.mostRecentSceneDef == desiredSceneDef)
{
outer.SetNextState(new RoR2MainEndingPlayCutscene());
}
}
public override void OnExit()
{
FadeToBlackManager.fadeCount--;
base.OnExit();
}
}