feat(CutLine): 实现切除连接线的逻辑
This commit is contained in:
@@ -27,6 +27,7 @@ namespace Script.Gameplay.Player
|
||||
inputManager.Input.Player.SetOutput.performed += ctx => SetOutTarget(currentTarget);
|
||||
inputManager.Input.Player.SetInput.performed += ctx => SetInputTarget(currentTarget);
|
||||
inputManager.Input.Player.Connect.performed += ctx => CreateConnection();
|
||||
inputManager.Input.Player.CutLine.performed += ctx => CutConnectLine(currentTarget);
|
||||
|
||||
if (raycaster == null)
|
||||
raycaster = GetComponent<FirstPersonRaycaster>() ?? GetComponentInChildren<FirstPersonRaycaster>();
|
||||
@@ -97,6 +98,14 @@ namespace Script.Gameplay.Player
|
||||
}
|
||||
}
|
||||
|
||||
public void CutConnectLine(IConnectable target)
|
||||
{
|
||||
if (target == null) return;
|
||||
if(target.OutputConnectionLine != null && target.InputConnectionLine != null) return;
|
||||
target.OutputConnectionLine?.DeleteConnection();
|
||||
target.InputConnectionLine?.DeleteConnection();
|
||||
}
|
||||
|
||||
private void CreateConnection()
|
||||
{
|
||||
if(!IsEnableConnecting) return;
|
||||
|
Reference in New Issue
Block a user