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;
|
||||
|
@@ -1,9 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.Gameplay.Player
|
||||
{
|
||||
public class PlayerConnectionLineController : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e152f6521db343f3aac46c7c448491bc
|
||||
timeCreated: 1760841639
|
Reference in New Issue
Block a user