using asap.core; using RootMotion.FinalIK; using System.Collections.Generic; using TMPro; using UnityEngine; using UniRx; public class Rod : MonoBehaviour { public GameObject rod; public Transform Bait; // 鱼饵的位置 public Transform TopLine; // 钓鱼竿的顶部位置 public Transform EndLine; public Transform Rod_Joint; public List LineList; public Transform LineHole; public LineRenderer fishingLineRenderer; public CCDIK cCDIK; public Transform LeftHandTargets; public Transform RightHandTargets; public Transform BodyTargets; public TMP_Text lineLength; System.IDisposable disposable; private void OnEnable() { disposable = GContext.OnEvent().Subscribe(OnFishingRotate); } private void OnDisable() { disposable?.Dispose(); disposable = null; } void OnFishingRotate(FishRotateEvent fishRotateEvent) { OnFishingRotate(fishRotateEvent.state); } private void OnFishingRotate(int state) { switch (state) { case 3: fishingLineRenderer.endWidth = 0.003f; break; case 4: fishingLineRenderer.endWidth = fishingLineRenderer.startWidth; break; } } }