修复一些状态问题

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
@@ -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()
{