修改了插头的功能,增加了插头触发对话,保险起见只触发一次
This commit is contained in:
@@ -183,7 +183,7 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp
|
||||
{
|
||||
currentSocket = closestSocket;
|
||||
currentSocket.InsertPlug(this);
|
||||
initialSocket.InsertPlug(this);
|
||||
//initialSocket.InsertPlug(this);
|
||||
OnPlugInserted?.Invoke(this); // 触发插入事件
|
||||
transform.position = currentSocket.GetPosition();
|
||||
plugSprite.enabled = false;
|
||||
@@ -196,7 +196,7 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp
|
||||
{
|
||||
//transform.rotation = startRotation;
|
||||
initialSocket.InsertPlug(this);
|
||||
OnPlugInserted?.Invoke(this); // 触发插入事件
|
||||
//OnPlugInserted?.Invoke(this); // 触发插入事件
|
||||
plugSprite.enabled =false; // Make the plug sprite disappear when it is inserted into the initial socket.
|
||||
});
|
||||
}
|
||||
|
||||
@@ -123,7 +123,9 @@ public class OscilloscopeController : MonoBehaviour
|
||||
}
|
||||
private void HandlePlugInserted(Plug plug)
|
||||
{
|
||||
DialogController.Instance.SetVariable("$currentSocket",plug.currentSocket.name);
|
||||
string originalString = plug.currentSocket.name;
|
||||
string trimmedString = originalString.Replace("Socket", "");
|
||||
DialogController.Instance.SetVariable("$currentSocket",trimmedString);
|
||||
DialogController.Instance.StartDialogNode("PlugInsert");
|
||||
// 这里可以处理插入后的波形显示逻辑
|
||||
Debug.Log("Plug inserted into the socket, starting waveform display.");
|
||||
@@ -341,10 +343,23 @@ private IEnumerator ScanForError(string trimmedString)
|
||||
if(targetData.HasExternalError())
|
||||
{
|
||||
|
||||
screenText.text="外部错误已关联,可以直接深入";
|
||||
screenText.text="记忆模块,允许直接进入";
|
||||
//waveformVisualizer.gameObject.SetActive(false);
|
||||
return;
|
||||
}
|
||||
else if(currentSocket.targetData.isCorrect)
|
||||
{
|
||||
string originalString = currentSocket.name;
|
||||
string trimmedString = originalString.Replace("Socket", "");
|
||||
screenText.text=trimmedString+ ":未检测到错误";
|
||||
return;
|
||||
}
|
||||
else if(!currentSocket.targetData.isCorrect)
|
||||
{
|
||||
string originalString = currentSocket.name;
|
||||
string trimmedString = originalString.Replace("Socket", "");
|
||||
screenText.text=trimmedString+ ":检测到异常,请寻找错误深入";
|
||||
}
|
||||
|
||||
if(!setInitSliderValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user