feat(Cycle):实现循环提前检测,修复交互提示消失,按键绑定的事件在重启的时候没能正确,触发循环的提前检测有错误
This commit is contained in:
@@ -12,6 +12,16 @@ namespace Script.Gameplay.Connect
|
||||
private IConnectable _pointA;
|
||||
private IConnectable _pointB;
|
||||
|
||||
public IConnectable PointA
|
||||
{
|
||||
get => _pointA;
|
||||
}
|
||||
|
||||
public IConnectable PointB
|
||||
{
|
||||
get => _pointB;
|
||||
}
|
||||
|
||||
private LineRenderer line;
|
||||
|
||||
private void Awake()
|
||||
@@ -31,11 +41,13 @@ namespace Script.Gameplay.Connect
|
||||
Debug.Log("ConnectionLine requires two valid IConnectable points.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (pointA == pointB)
|
||||
{
|
||||
Debug.Log("ConnectionLine cannot connect the same point.");
|
||||
return;
|
||||
}
|
||||
|
||||
_pointA = pointA;
|
||||
_pointB = pointB;
|
||||
pointA.ConnectionLines.Add(this);
|
||||
@@ -81,10 +93,12 @@ namespace Script.Gameplay.Connect
|
||||
|
||||
public void OnSignalReceived(bool active, GameObject sender)
|
||||
{
|
||||
SendSignal(active,this.gameObject);
|
||||
SendSignal(active, this.gameObject);
|
||||
}
|
||||
|
||||
public void SendSignal(bool active,GameObject sender)
|
||||
public bool IsEnableSendSignal { get; set; } = true;
|
||||
|
||||
public void SendSignal(bool active, GameObject sender)
|
||||
{
|
||||
var a = _pointA as ISignalReceiver;
|
||||
var b = _pointB as ISignalReceiver;
|
||||
@@ -93,6 +107,7 @@ namespace Script.Gameplay.Connect
|
||||
{
|
||||
a.OnSignalReceived(active, this.gameObject);
|
||||
}
|
||||
|
||||
if (b != senderR)
|
||||
{
|
||||
b.OnSignalReceived(active, this.gameObject);
|
||||
|
||||
Reference in New Issue
Block a user