拿起放下物品
This commit is contained in:
@@ -58,24 +58,18 @@ namespace NBF
|
||||
_Animator.keepAnimatorStateOnDisable = true;
|
||||
_IK = GetComponent<PlayerIK>();
|
||||
_isInit = true;
|
||||
|
||||
Player.OnFishingSetEquiped += OnFishingSetEquiped_OnRaised;
|
||||
Player.OnFishingSetUnequip += OnFishingSetUnequip;
|
||||
Player.Data.OnStateChange += PlayerFSMState_OnValueChanged;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
Player.OnFishingSetEquiped -= OnFishingSetEquiped_OnRaised;
|
||||
Player.OnFishingSetUnequip -= OnFishingSetUnequip;
|
||||
Player.Data.OnStateChange += PlayerFSMState_OnValueChanged;
|
||||
}
|
||||
|
||||
// private void OnEnable()
|
||||
// {
|
||||
// playerFSMState.OnValueChanged += PlayerFSMState_OnValueChanged;
|
||||
// }
|
||||
//
|
||||
// private void OnDisable()
|
||||
// {
|
||||
// playerFSMState.OnValueChanged -= PlayerFSMState_OnValueChanged;
|
||||
// }
|
||||
|
||||
private void OnFishingSetUnequip()
|
||||
{
|
||||
@@ -99,12 +93,18 @@ namespace NBF
|
||||
// }
|
||||
}
|
||||
|
||||
// private void OnFishingSetEquiped_OnRaised(FishingSetController set)
|
||||
// {
|
||||
// _isTorsoLayerEnabled = true;
|
||||
// var reel = Player.Rod.Reel;
|
||||
// // _IK.SetBipedLeftHandIK(enabled: false, reel.FingersIKAnchor);
|
||||
// }
|
||||
private void OnFishingSetEquiped_OnRaised(FHandItem item)
|
||||
{
|
||||
if (item is FRod rod)
|
||||
{
|
||||
_isTorsoLayerEnabled = true;
|
||||
// var reel = Player.Rod.Reel;
|
||||
// _IK.SetBipedLeftHandIK(enabled: false, reel.FingersIKAnchor);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void PlayAnimation(string state, string layer)
|
||||
{
|
||||
@@ -233,40 +233,5 @@ namespace NBF
|
||||
SetLayerWeight(Torso,
|
||||
Mathf.MoveTowards(layerWeight, _isTorsoLayerEnabled ? 1f : 0f, Time.deltaTime * 3f));
|
||||
}
|
||||
|
||||
|
||||
// private void LateUpdate()
|
||||
// {
|
||||
// if (!_isInit) return;
|
||||
// UpdateAnimator();
|
||||
// }
|
||||
//
|
||||
//
|
||||
// private void UpdateAnimator()
|
||||
// {
|
||||
// Animator.SetBool(OnGround, Player.Data.IsGrounded);
|
||||
// float value3 = Mathf.Lerp(Animator.GetFloat(Forward), Player.Data.Speed / 5f, Time.deltaTime * 20f);
|
||||
// Animator.SetFloat(Forward, value3);
|
||||
//
|
||||
// // 平滑处理
|
||||
// // float smoothedTurn = Mathf.SmoothDamp(Animator.GetFloat(Turn),
|
||||
// // MapUnit.RotationSpeed,
|
||||
// // ref turnSmoothVelocity,
|
||||
// // smoothingTime
|
||||
// // );
|
||||
//
|
||||
// float smoothedTurn = Mathf.Lerp(Animator.GetFloat(Turn), Player.Data.RotationSpeed, Time.deltaTime * 10f);
|
||||
// Animator.SetFloat(Turn, smoothedTurn);
|
||||
//
|
||||
//
|
||||
// float layerWeight = Animator.GetLayerWeight(Animator.GetLayerIndex(Torso));
|
||||
// SetLayerWeight(Torso,
|
||||
// Mathf.MoveTowards(layerWeight, _isTorsoLayerEnabled ? 1f : 0f, Time.deltaTime * 3f));
|
||||
// }
|
||||
//
|
||||
// public void SetLayerWeight(string layer, float weight)
|
||||
// {
|
||||
// Animator.SetLayerWeight(Animator.GetLayerIndex(layer), weight);
|
||||
// }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user