feat(Signal):实现信号传输的单向连续传播
This commit is contained in:
@@ -17,19 +17,13 @@ namespace Script.Gameplay.Facility
|
||||
public override void Interact(GameObject interactor)
|
||||
{
|
||||
if (!IsEnableInteract) return;
|
||||
PullLever();
|
||||
PullLever(this.gameObject);
|
||||
}
|
||||
|
||||
public override void OnSignalReceived(bool active, GameObject sender)
|
||||
{
|
||||
base.OnSignalReceived(active, sender);
|
||||
//PullLever();
|
||||
}
|
||||
|
||||
private void PullLever()
|
||||
private void PullLever(GameObject sender = null)
|
||||
{
|
||||
isPulled = !isPulled;
|
||||
SendSignal(isPulled, this.gameObject);
|
||||
SendSignal(isPulled, sender);
|
||||
// 可选:拉杆动画
|
||||
if (isPulled)
|
||||
{
|
||||
@@ -42,6 +36,5 @@ namespace Script.Gameplay.Facility
|
||||
transform.rotation = Quaternion.Euler(0f, 0f, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user