r2mods/ilspy_dump/ror2_csproj/EntityStates.SurvivorPod/Landed.cs

41 lines
1010 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine;
namespace EntityStates.SurvivorPod;
public class Landed : SurvivorPodBaseState
{
private static int IdleStateHash = Animator.StringToHash("Idle");
public override void OnEnter()
{
base.OnEnter();
PlayAnimation("Base", IdleStateHash);
Util.PlaySound("Play_UI_podSteamLoop", base.gameObject);
base.vehicleSeat.handleVehicleExitRequestServer.AddCallback(HandleVehicleExitRequest);
}
public override void FixedUpdate()
{
if (base.fixedAge > 0f)
{
base.survivorPodController.exitAllowed = true;
}
base.FixedUpdate();
}
private void HandleVehicleExitRequest(GameObject gameObject, ref bool? result)
{
base.survivorPodController.exitAllowed = false;
outer.SetNextState(new PreRelease());
result = true;
}
public override void OnExit()
{
base.vehicleSeat.handleVehicleExitRequestServer.RemoveCallback(HandleVehicleExitRequest);
base.survivorPodController.exitAllowed = false;
Util.PlaySound("Stop_UI_podSteamLoop", base.gameObject);
}
}