修复一些状态问题

This commit is contained in:
2024-11-01 18:19:03 +08:00
parent 2b4386e26d
commit 913a607b68
4 changed files with 27 additions and 7 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ public class ClueBoardManager : MonoBehaviour
public IEnumerator WaitForClose()
{
// 这里等待关闭按钮点击事件
while (!isBoardOpen)
while (isBoardOpen)
{
yield return null; // 每帧检查一次
}
@@ -45,8 +45,26 @@ public class OscilloscopeController : MonoBehaviour
DeepInButton.GetComponent<Button>().onClick.AddListener(DeepIn);
screenText.text="";
currentSocket=null;
if(plug!=null)
{
plug.OnPlugInserted += HandlePlugInserted;
plug.OnPlugRemoved += HandlePlugRemoved;
}
}
private void HandlePlugInserted(Plug plug)
{
// 这里可以处理插入后的波形显示逻辑
Debug.Log("Plug inserted into the socket, starting waveform display.");
}
private void HandlePlugRemoved()
{
// 这里可以处理移除后的清除波形逻辑
screenText.text="";
Debug.Log("Plug removed from the socket, stopping waveform display.");
}
public void DeepIn()
{