using NBC;
using UnityEngine;

namespace NBF
{
    public abstract class PlayerStateBase : FsmBaseState<FPlayer>
    {
        protected FPlayer Fish => _owner;


        protected void SetArm()
        {
            if (_owner.Gears.Reel)
            {
                _owner.MinorArm.SetReelHandle(_owner.Gears.Reel.reelAsset);
                // _owner.MinorArm.IK.solver.target = _owner.Gears.Reel.reelAsset.handle;
                // _owner.MinorArm.IK.enabled = true;
            }
        }

        /// <summary>
        /// 检查状态超时
        /// </summary>
        public void CheckStateTimeout(float time)
        {
            if (Time.time - EnterTime >= time)
            {
                Root.Start<PlayerIdle>();
            }
        }

        protected void TakeLineToHand()
        {
            // GameInput.isPullUpRod = true;
            // // if(_owner.HandsAnimator.GetCurrentAnimatorClipInfo().)
            // _owner.HandsAnimator.SetBool(Anim.RightFingersOnRodPowered, true);
            // _owner.HandsAnimator.SetBool(Anim.LHandPreCast, true);


            // if (_owner.handPullUp >= 1)
            // {
            //     // var connector = _owner.currentRod.currentLine.currentLineHandler.LineConnector_1.transform;
            //     // var handPoint = _owner.lHandPlayerHelperLinePoint;
            //
            //     // _owner.PutLineToLeftHandHelper(connector, handPoint, 3f);
            // }
        }

        // protected void OutLineToHand()
        // {
        //     // GameInput.isPullUpRod = false;
        //     
        //     var connector = _owner.currentRod.currentLine.currentLineHandler.LineConnector_1.transform;
        //     _owner.OutLineFromLeftHandHelper(connector);
        // }
    }
}