Merge branch 'bugfix/插孔打开时机问题' into 'develop'
fix: 插孔打开时机 See merge request aibis-dream/aibis-dream!740
This commit is contained in:
@@ -271,6 +271,7 @@ namespace AibisDream.FixSystem
|
||||
physicCableRef.SetPointer(pointerWorldPos);
|
||||
}
|
||||
|
||||
/// <summary>拖拽中根据与模块距离设置/清除线缆吸附目标;不控制插孔盖开合。</summary>
|
||||
public void UpdateDragProximity(Vector3 pointerWorldPos)
|
||||
{
|
||||
if (physicCableRef == null || BodyModuleSystem?.BodyModules == null)
|
||||
@@ -282,16 +283,15 @@ namespace AibisDream.FixSystem
|
||||
float assistRange = Mathf.Max(snapRange, snapRange * dragAssistRangeMultiplier);
|
||||
if (TryFindClosestModuleWithin(pointerWorldPos, assistRange, out var targetModule))
|
||||
{
|
||||
targetModule.OpenPlugSlot();
|
||||
BodyModuleSystem.CloseModuleSlots(targetModule);
|
||||
physicCableRef.SetDragAssistTarget(targetModule.GetSocketPos(), assistRange);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClearDragHighlight();
|
||||
physicCableRef.ClearDragAssistTarget();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>结束拖拽:清除吸附并关闭所有插孔盖。</summary>
|
||||
public void ClearDragHighlight()
|
||||
{
|
||||
physicCableRef?.ClearDragAssistTarget();
|
||||
@@ -321,9 +321,7 @@ namespace AibisDream.FixSystem
|
||||
/// <returns>是否能找到目标范围内的Module</returns>
|
||||
public bool TryFindClosestModule(Vector3 sourcePos, out BodyModule targetModule)
|
||||
{
|
||||
var res = BodyModuleSystem.TryFindClosestModule(sourcePos, out targetModule);
|
||||
BodyModuleSystem.CloseModuleSlots(targetModule);
|
||||
return res;
|
||||
return BodyModuleSystem.TryFindClosestModule(sourcePos, out targetModule);
|
||||
}
|
||||
|
||||
private bool TryFindClosestModuleWithin(Vector3 sourcePos, float range, out BodyModule targetModule)
|
||||
|
||||
Reference in New Issue
Block a user