fix(fix-system): 优化线缆物理拖拽和像素风渲染

This commit is contained in:
2026-07-09 00:51:34 +08:00
parent f273569e7c
commit 2e7c87c886
4 changed files with 635 additions and 144 deletions
@@ -53,11 +53,26 @@ namespace AibisDream.FixSystem
UpdateOutletPosition();
}
/// <summary>遗留兼容(旧 CableSystem 场景仍在调用)。</summary>
public void UpdateRotation()
{
// 如果PhysicCable激活,不进行旋转
if (cablePanel == null || cablePanel.PlugRef == null ||
cablePanel.PhysicCableRef.GetComponent<LineRenderer>().enabled) return;
if (cablePanel == null || cablePanel.PlugRef == null) return;
UpdateRotation(true);
}
/// <summary>拖拽/插接中朝拉力方向施加扭矩;闲置时缓动回正。</summary>
public void UpdateRotation(bool active)
{
if (cablePanel == null || cablePanel.PlugRef == null) return;
if (!active)
{
angularVelocity = 0f;
currentAngle = Mathf.LerpAngle(currentAngle, 0f, 4f * Time.deltaTime);
transform.rotation = Quaternion.Euler(0, 0, currentAngle);
UpdateOutletPosition();
return;
}
Vector2 center = transform.position;