This commit is contained in:
2025-01-25 13:29:46 +08:00
parent b47b29f996
commit 5703efd59e
10 changed files with 392 additions and 67 deletions
@@ -1,4 +1,5 @@
using System;
using DG.Tweening.Plugins.Core.PathCore;
using UnityEngine;
namespace AibisDream.FixSystem
@@ -7,6 +8,8 @@ namespace AibisDream.FixSystem
public class Cable : MonoBehaviour
{
private Transform _start;
public Transform _controlPoint;
private Transform _end;
private LineRenderer _lineRenderer;
@@ -65,6 +68,7 @@ namespace AibisDream.FixSystem
float t = Mathf.InverseLerp(config.dstMin, config.dstMax, (_start.position - _end.position).magnitude);
float F = Mathf.Lerp(config.forceMin, config.forceMax, t);
_points[0] = _start.position;
_points[1] = _controlPoint.position;
_points[^1] = _end.position;
for (int ik = 0; ik < config.k; ik++)