SanAndreasUnity/Assets/Scripts/Behaviours/Ped/States/StandAimState.cs

42 lines
980 B
C#
Raw Normal View History

2020-05-31 17:07:22 +00:00
using UnityEngine;
using SanAndreasUnity.Utilities;
using SanAndreasUnity.Importing.Animation;
namespace SanAndreasUnity.Behaviours.Peds.States
{
public class StandAimState : BaseAimMovementState
{
public override AnimId aimWithArm_LowerAnim { get { return m_ped.CurrentWeapon.IdleAnim; } }
public override void OnBecameActive ()
{
base.OnBecameActive ();
// m_ped.PlayerModel.PlayAnim (AnimGroup.MyWalkCycle, AnimIndex.GUN_STAND);
}
protected override AnimationState UpdateAnimsNonAWA ()
{
return StandAimState.UpdateAnimsNonAWA (m_ped);
}
public static AnimationState UpdateAnimsNonAWA(Ped ped)
{
ped.PlayerModel.Play2Anims( ped.CurrentWeapon.AimAnim, ped.CurrentWeapon.AimAnimLowerPart );
// some anims don't set root frame velocity, so we have to set it
ped.PlayerModel.RootFrame.LocalVelocity = Vector3.zero;
var state = ped.PlayerModel.LastAnimState;
state.wrapMode = WrapMode.ClampForever;
return state;
}
}
}