先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
55 lines
1.3 KiB
C#
55 lines
1.3 KiB
C#
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<Transform> 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<FishRotateEvent>().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;
|
|
|
|
}
|
|
}
|
|
|
|
} |