r2mods/ilspy_dump/ror2_csproj/EntityStates.Commando.Comma.../ReloadPistols.cs

33 lines
1.2 KiB
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace EntityStates.Commando.CommandoWeapon;
public class ReloadPistols : GenericReload
{
private static int ReloadPistolsStateHash = Animator.StringToHash("ReloadPistols");
private static int ReloadPistolsParamHash = Animator.StringToHash("ReloadPistols.playbackRate");
private static int ReloadPistolsExitStateHash = Animator.StringToHash("ReloadPistolsExit");
public override void OnEnter()
{
base.OnEnter();
PlayAnimation("Gesture, Override", ReloadPistolsStateHash, ReloadPistolsParamHash, duration);
PlayAnimation("Gesture, Additive", ReloadPistolsStateHash, ReloadPistolsParamHash, duration);
FindModelChild("GunMeshL")?.gameObject.SetActive(value: false);
FindModelChild("GunMeshR")?.gameObject.SetActive(value: false);
}
public override void OnExit()
{
FindModelChild("ReloadFXL")?.gameObject.SetActive(value: false);
FindModelChild("ReloadFXR")?.gameObject.SetActive(value: false);
FindModelChild("GunMeshL")?.gameObject.SetActive(value: true);
FindModelChild("GunMeshR")?.gameObject.SetActive(value: true);
PlayAnimation("Gesture, Override", ReloadPistolsExitStateHash);
PlayAnimation("Gesture, Additive", ReloadPistolsExitStateHash);
base.OnExit();
}
}