处理plug和线缆以及几个bug

This commit is contained in:
2025-05-30 15:13:06 +08:00
parent bdb514fc46
commit 73fd121052
10 changed files with 1152 additions and 829 deletions
@@ -11,6 +11,7 @@ namespace AibisDream.FixSystem
public PhysicCable PhysicCableRef { get; private set; }
public Transform CableRootPos { get; private set; }
public CableReel CableReelRef { get; private set; }
public BodyModuleSystem BodyModuleSystem { get; private set; }
@@ -52,7 +53,8 @@ namespace AibisDream.FixSystem
{
PlugRef = transform.Find("Plug").GetComponent<Plug>();
CableRef = transform.Find("Cable").GetComponent<Cable>();
CableRootPos = transform.Find("Cable Root Pos").transform;
CableReelRef = transform.Find("CableReel").GetComponent<CableReel>();
CableRootPos = CableReelRef.transform.Find("Cable Root Pos").transform;
PhysicCableRef = transform.Find("PhysicCable").GetComponent<PhysicCable>();
BodyModuleSystem = transform.parent.GetComponent<BodyModuleSystem>();
@@ -64,6 +66,15 @@ namespace AibisDream.FixSystem
PlugRef.InitPlug();
}
private void Update()
{
// 获取线缆方向并更新转盘旋转
if (CableRef != null && CableReelRef != null)
{
CableReelRef.UpdateRotation();
}
}
public void ResetPlug()
{
// 不在初始插孔里,就从当前插孔拔出来,插回初始插孔