修复一些状态问题
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user