提交动画相关内容个、
This commit is contained in:
@@ -10,7 +10,7 @@ namespace NBF
|
||||
public Animator _Animator;
|
||||
public FPlayer Player { get; private set; }
|
||||
|
||||
private bool _isTorsoLayerEnabled;
|
||||
private bool _isRodLayerEnabled;
|
||||
private bool _isInit;
|
||||
private PlayerIK _IK;
|
||||
private MagicBlending _magicBlending;
|
||||
@@ -45,7 +45,8 @@ namespace NBF
|
||||
public static readonly int PreciseIdle = Animator.StringToHash("Precise Idle");
|
||||
|
||||
|
||||
public static readonly string Torso = "Torso";
|
||||
public static readonly string LureRodLayer = "LureRod";
|
||||
public static readonly string HandRodLayer = "HandRod";
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -73,7 +74,7 @@ namespace NBF
|
||||
|
||||
private void OnFishingSetUnequip()
|
||||
{
|
||||
_isTorsoLayerEnabled = false;
|
||||
_isRodLayerEnabled = false;
|
||||
_IK.SetBipedLeftHandIK(enabled: false, null);
|
||||
}
|
||||
|
||||
@@ -97,7 +98,7 @@ namespace NBF
|
||||
{
|
||||
if (item is FRod rod)
|
||||
{
|
||||
_isTorsoLayerEnabled = true;
|
||||
_isRodLayerEnabled = true;
|
||||
// var reel = Player.Rod.Reel;
|
||||
// _IK.SetBipedLeftHandIK(enabled: false, reel.FingersIKAnchor);
|
||||
}
|
||||
@@ -229,9 +230,19 @@ namespace NBF
|
||||
_Animator.SetBool(OnGround, _IsInVehicle || Player.Data.IsGrounded);
|
||||
_Animator.SetFloat(RodRight, rod.x);
|
||||
_Animator.SetFloat(RodForward, rod.y);
|
||||
float layerWeight = _Animator.GetLayerWeight(_Animator.GetLayerIndex(Torso));
|
||||
SetLayerWeight(Torso,
|
||||
Mathf.MoveTowards(layerWeight, _isTorsoLayerEnabled ? 1f : 0f, Time.deltaTime * 3f));
|
||||
|
||||
|
||||
var isHandRodLayerEnabled = _isRodLayerEnabled && !Player.Data.IsLureRod ? 1 : 0;
|
||||
|
||||
float handRodLayerWeight = _Animator.GetLayerWeight(_Animator.GetLayerIndex(HandRodLayer));
|
||||
SetLayerWeight(HandRodLayer,
|
||||
Mathf.MoveTowards(handRodLayerWeight, isHandRodLayerEnabled, Time.deltaTime * 3f));
|
||||
|
||||
|
||||
var isLureRodLayerEnabled = _isRodLayerEnabled && Player.Data.IsLureRod ? 1 : 0;
|
||||
float lureRodLayerWeight = _Animator.GetLayerWeight(_Animator.GetLayerIndex(LureRodLayer));
|
||||
SetLayerWeight(LureRodLayer,
|
||||
Mathf.MoveTowards(lureRodLayerWeight, isLureRodLayerEnabled, Time.deltaTime * 3f));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user