船相关脚本呢
This commit is contained in:
@@ -26,7 +26,6 @@ public partial class FPlayer : MonoBehaviour
|
||||
|
||||
public PlayerAnimator PlayerAnimatorCtrl;
|
||||
|
||||
|
||||
public FPlayerUseGear Gears;
|
||||
|
||||
public LureTrajectorySimulator LureTrajectorySimulator;
|
||||
@@ -34,6 +33,10 @@ public partial class FPlayer : MonoBehaviour
|
||||
public Transform Light;
|
||||
|
||||
public Transform BackSpine;
|
||||
|
||||
public CapsuleCollider Collider;
|
||||
|
||||
public Rigidbody Rigidbody;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -53,6 +56,7 @@ public partial class FPlayer : MonoBehaviour
|
||||
|
||||
PlayerAnimatorCtrl.Player = this;
|
||||
Arms = GetComponentsInChildren<PlayerArm>();
|
||||
Collider = GetComponent<CapsuleCollider>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
@@ -72,6 +76,7 @@ public partial class FPlayer : MonoBehaviour
|
||||
|
||||
if (data.PlayerID == GameModel.RoleID)
|
||||
{
|
||||
Fishing.Inst.Player.SelfPlayer = this;
|
||||
BaseCamera.Main.transform.SetParent(CameraRoot);
|
||||
BaseCamera.Main.transform.localPosition = Vector3.zero;
|
||||
}
|
||||
@@ -158,6 +163,8 @@ public partial class FPlayer : MonoBehaviour
|
||||
private Tween _fovTween; // 存储当前的Tween动画,方便中断
|
||||
private float _zoomDuration = 0.2f; // 缩放动画时间
|
||||
|
||||
public Boat NowBoat { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 切换望远镜效果(打开/关闭)
|
||||
/// </summary>
|
||||
@@ -183,4 +190,20 @@ public partial class FPlayer : MonoBehaviour
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void EnterBoat(Boat boat)
|
||||
{
|
||||
NowBoat = boat;
|
||||
transform.parent = boat.standPlace;
|
||||
transform.localPosition = Vector3.zero;
|
||||
Collider.enabled = false;
|
||||
Rigidbody.isKinematic = false;
|
||||
}
|
||||
|
||||
public void ExitBoat()
|
||||
{
|
||||
NowBoat = null;
|
||||
Collider.enabled = true;
|
||||
Rigidbody.isKinematic = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user