首次提交
This commit is contained in:
53
Assets/Scripts/Fishing~/Player/Gear/FReel.cs
Normal file
53
Assets/Scripts/Fishing~/Player/Gear/FReel.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using NBF;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
public class FReel : FPlayerGear
|
||||
{
|
||||
public bool isBlockLineByFinger { get; set; }
|
||||
|
||||
|
||||
[SerializeField] public float reelingDrag = 1f;
|
||||
|
||||
|
||||
public ReelAsset reelAsset;
|
||||
|
||||
public ReelAnimator AnimatorCtrl;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
reelAsset = GetComponent<ReelAsset>();
|
||||
AnimatorCtrl = reelAsset.animator.gameObject.GetComponent<ReelAnimator>();
|
||||
if (AnimatorCtrl == null)
|
||||
{
|
||||
AnimatorCtrl = reelAsset.animator.gameObject.AddComponent<ReelAnimator>();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
AnimatorCtrl.Reeling = Owner.Data.reelSpeed;
|
||||
if (Owner.Data.reelSpeed > 0)
|
||||
{
|
||||
Unlock();
|
||||
}
|
||||
// Reeling();
|
||||
}
|
||||
|
||||
public void Unlock(bool unlock = true)
|
||||
{
|
||||
if (unlock)
|
||||
{
|
||||
AnimatorCtrl.Unlock = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
AnimatorCtrl.Unlock = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user