修改arm

This commit is contained in:
2026-01-17 22:46:58 +08:00
parent f7d44f1f8d
commit a46436ae45
34 changed files with 47057 additions and 26303 deletions

View File

@@ -10,41 +10,43 @@ namespace NBF
{
public override uint StateId => (uint)PlayerState.Throw;
public enum Phase
{
/// <summary>
/// 等待动画事件回调
/// </summary>
Waiting,
/// <summary>
/// 前摇动画
/// </summary>
AnimBegin,
/// <summary>
/// 抛线动画
/// </summary>
ThrowAnim,
/// <summary>
/// 结束
/// </summary>
Done,
ErrorDone
}
public Phase Stage = Phase.Waiting;
// public enum Phase
// {
// /// <summary>
// /// 等待动画事件回调
// /// </summary>
// Waiting,
//
// /// <summary>
// /// 前摇动画
// /// </summary>
// AnimBegin,
//
// /// <summary>
// /// 抛线动画
// /// </summary>
// ThrowAnim,
//
// /// <summary>
// /// 结束
// /// </summary>
// Done,
// ErrorDone
// }
//
// public Phase Stage = Phase.Waiting;
private bool _nextState = false;
public float ChargedProgress;
protected override void onEnter()
{
Log.Info("enter PlayerStateThrow");
_owner.ModelAsset.PlayerAnimator.StartThrow = true;
ChargedProgress = (float)Params.Get(0);
Debug.Log($"PlayerThrow ChargedProgress={ChargedProgress}");
Stage = Phase.Waiting;
_nextState = false;
// Stage = Phase.Waiting;
// _owner.Gears.Reel?.Unlock();
}
@@ -52,23 +54,10 @@ namespace NBF
protected override uint onUpdate()
{
CheckStateTimeout(10);
if (Stage == Phase.AnimBegin)
{
AnimBegin();
ThrowPosition();
}
else if (Stage == Phase.ThrowAnim)
{
ThrowAnim();
}
else if (Stage == Phase.Done)
if (_nextState)
{
return (uint)PlayerState.Fishing;
}
else if (Stage == Phase.ErrorDone)
{
return (uint)PlayerState.Idle;
}
return base.onUpdate();
}
@@ -78,66 +67,17 @@ namespace NBF
/// <summary>
/// 抛竿动画事件
/// </summary>
public void RodForceThrowStart()
public void OnRodThrowStart()
{
// Debug.LogError($"RodForceThrowStart==");
Debug.LogError("OnRodThrowStart");
_owner.ModelAsset.PlayerAnimator.PrepareThrow = false;
_owner.ModelAsset.PlayerAnimator.StartThrow = false;
Stage = Phase.AnimBegin;
}
#endregion
#region 线
private void AnimBegin()
public void OnRodThrownEnd()
{
_owner.ModelAsset.PlayerAnimator.PrepareThrow = false;
_owner.ModelAsset.PlayerAnimator.StartThrow = false;
_owner.ModelAsset.PlayerAnimator.BaitThrown = true;
Stage = Phase.ThrowAnim;
}
#endregion
#region 竿线
private NTask _throwAnim;
private void ThrowPosition()
{
// if (_owner.PlayerAnimatorCtrl.ThrowMode == ThrowModeEnum.Float)
// {
// _owner.Gears.Rod.lineHandler.pinchController?.ReleasePinch();
// _throwAnim = new BobThrowAnim(_owner);
// _throwAnim.Run(DefRunner.Scheduler);
// }
// else
// {
// _throwAnim = new LureThrowAnim(_owner);
// _throwAnim.Run(DefRunner.Scheduler);
// }
}
private void ThrowAnim()
{
if (_throwAnim.IsDone)
{
// if (_throwAnim.Status == NTaskStatus.Success)
// {
// if (_owner.PlayerAnimatorCtrl.ThrowMode == ThrowModeEnum.Spin)
// {
// SetArm();
// }
//
// Stage = Phase.Done;
// Debug.LogError($"抛线后,线长度={_owner.Data.lineLength}");
// }
// else
// {
// Stage = Phase.ErrorDone;
// }
}
Debug.LogError("OnRodThrownEnd");
_nextState = true;
}
#endregion