diff --git a/Assets/Prototype/佩佩/Scripts/EyeManager.cs b/Assets/Prototype/佩佩/Scripts/EyeManager.cs index d740a9a87..80f363225 100644 --- a/Assets/Prototype/佩佩/Scripts/EyeManager.cs +++ b/Assets/Prototype/佩佩/Scripts/EyeManager.cs @@ -145,7 +145,7 @@ public void Initialize() { yield break; } - DialogController.Instance.SetVariable("$currentTarget",target.name); + DialogController.Instance.SetVariable("$currentEyeTarget",target.name); StartCoroutine(EyeEffectFadeOut()); float duration = eyeStateEffect.TransitionDuration; diff --git a/Assets/Prototype/佩佩/Scripts/EyeTransitionManager.cs b/Assets/Prototype/佩佩/Scripts/EyeTransitionManager.cs index ab1caf318..62f951e2e 100644 --- a/Assets/Prototype/佩佩/Scripts/EyeTransitionManager.cs +++ b/Assets/Prototype/佩佩/Scripts/EyeTransitionManager.cs @@ -235,6 +235,21 @@ public class EyeTransitionManager : MonoBehaviour } } + [YarnCommand("SetExternalError")] + public void SetExternalError(string targetViewStateName,bool hasExternalError) + { + ViewState targetViewState; + if (!Enum.TryParse(targetViewStateName, out targetViewState)) + { + Debug.LogError("Invalid ViewState name: " + targetViewStateName); + + return; + + } + if (!viewConfigDictionary.TryGetValue(targetViewState, out ViewConfig config)) return; + + config.socket.targetData.isExternalError=hasExternalError; + } private void InitializeView() { diff --git a/Assets/Prototype/佩佩/佩佩视觉模块.unity b/Assets/Prototype/佩佩/佩佩视觉模块.unity index e1e49993b..3b14b484e 100644 --- a/Assets/Prototype/佩佩/佩佩视觉模块.unity +++ b/Assets/Prototype/佩佩/佩佩视觉模块.unity @@ -626,8 +626,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: - waitYarnCommand: 1 - notAlowedDeep: 0 + notAlowedDeep: 1 targetData: {fileID: 0} --- !u!114 &7986263 MonoBehaviour: @@ -681,6 +680,7 @@ MonoBehaviour: m_EditorClassIdentifier: waveformType: 1 isCorrect: 0 + isExternalError: 0 randomShift: 0 initialRandomPhase: 0 spikeIndex: -1 @@ -2739,7 +2739,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: - waitYarnCommand: 0 notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &144553464 @@ -2794,6 +2793,7 @@ MonoBehaviour: m_EditorClassIdentifier: waveformType: 1 isCorrect: 1 + isExternalError: 0 randomShift: 0 initialRandomPhase: 0 spikeIndex: -1 @@ -6388,8 +6388,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: - waitYarnCommand: 1 - notAlowedDeep: 0 + notAlowedDeep: 1 targetData: {fileID: 0} --- !u!114 &265611527 MonoBehaviour: @@ -6443,6 +6442,7 @@ MonoBehaviour: m_EditorClassIdentifier: waveformType: 1 isCorrect: 0 + isExternalError: 0 randomShift: 0 initialRandomPhase: 0 spikeIndex: -1 @@ -7046,6 +7046,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 602eb1c35172a264099ff28df4f1bdc8, type: 3} m_Name: m_EditorClassIdentifier: + hoverCursor: {fileID: 0} --- !u!61 &295548116 BoxCollider2D: m_ObjectHideFlags: 0 @@ -10432,7 +10433,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: - waitYarnCommand: 0 notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &585617292 @@ -10487,6 +10487,7 @@ MonoBehaviour: m_EditorClassIdentifier: waveformType: 6 isCorrect: 1 + isExternalError: 0 randomShift: 0 initialRandomPhase: 0 spikeIndex: -1 @@ -13289,7 +13290,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: - waitYarnCommand: 0 notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &697311005 @@ -13344,6 +13344,7 @@ MonoBehaviour: m_EditorClassIdentifier: waveformType: 3 isCorrect: 1 + isExternalError: 0 randomShift: 0 initialRandomPhase: 0 spikeIndex: -1 @@ -16201,6 +16202,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 602eb1c35172a264099ff28df4f1bdc8, type: 3} m_Name: m_EditorClassIdentifier: + hoverCursor: {fileID: 0} --- !u!1 &960673425 GameObject: m_ObjectHideFlags: 0 @@ -17271,7 +17273,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: - waitYarnCommand: 0 notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &1079123348 @@ -18916,8 +18917,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: - waitYarnCommand: 1 - notAlowedDeep: 0 + notAlowedDeep: 1 targetData: {fileID: 0} --- !u!114 &1177703836 MonoBehaviour: @@ -18971,6 +18971,7 @@ MonoBehaviour: m_EditorClassIdentifier: waveformType: 1 isCorrect: 0 + isExternalError: 0 randomShift: 0 initialRandomPhase: 0 spikeIndex: -1 @@ -20232,6 +20233,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 602eb1c35172a264099ff28df4f1bdc8, type: 3} m_Name: m_EditorClassIdentifier: + hoverCursor: {fileID: 0} --- !u!61 &1244002776 BoxCollider2D: m_ObjectHideFlags: 0 @@ -20705,7 +20707,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: - waitYarnCommand: 0 notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &1261765724 @@ -20760,6 +20761,7 @@ MonoBehaviour: m_EditorClassIdentifier: waveformType: 2 isCorrect: 1 + isExternalError: 0 randomShift: 0 initialRandomPhase: 0 spikeIndex: -1 @@ -23850,7 +23852,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: - waitYarnCommand: 1 notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &1451543709 @@ -23905,6 +23906,7 @@ MonoBehaviour: m_EditorClassIdentifier: waveformType: 0 isCorrect: 1 + isExternalError: 0 randomShift: 0 initialRandomPhase: 0 spikeIndex: -1 @@ -27895,6 +27897,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 602eb1c35172a264099ff28df4f1bdc8, type: 3} m_Name: m_EditorClassIdentifier: + hoverCursor: {fileID: 0} --- !u!61 &1715975304 BoxCollider2D: m_ObjectHideFlags: 0 @@ -28779,6 +28782,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 602eb1c35172a264099ff28df4f1bdc8, type: 3} m_Name: m_EditorClassIdentifier: + hoverCursor: {fileID: 0} --- !u!61 &1738809425 BoxCollider2D: m_ObjectHideFlags: 0 @@ -34168,7 +34172,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: - waitYarnCommand: 0 notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &2031366195 @@ -34223,6 +34226,7 @@ MonoBehaviour: m_EditorClassIdentifier: waveformType: 0 isCorrect: 0 + isExternalError: 0 randomShift: 0 initialRandomPhase: 0 spikeIndex: -1 @@ -35180,6 +35184,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 602eb1c35172a264099ff28df4f1bdc8, type: 3} m_Name: m_EditorClassIdentifier: + hoverCursor: {fileID: 0} --- !u!61 &2097798911 BoxCollider2D: m_ObjectHideFlags: 0 diff --git a/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn b/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn index 1b722c8c9..6672d6cab 100644 --- a/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn +++ b/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn @@ -4,18 +4,14 @@ position: 298,-2552 --- 新闻:balbalbal <> -// <> - -<> +//统计进入视觉后触发目标的次数,主要是用来触发第一次点击任意目标触发首次对话,以及判断是否收集够打孔带 +<> +//统计查看记忆数目,用来判断是否收集够 <> -<> -//<> -<> +//方便的触发针对eyetarget的对话,如果不喜欢这种写法可以商量,然后分开写 +<> +//如果线索板都答对了,就自动触发这个为true <> - -// //<> -// <> -//初始化 <> === title: 日常对话 @@ -83,17 +79,17 @@ title: IntoEyeView tags: position: 2127,-2063 --- -<> - <> +<> + <> <> <> - <> + <> <> - <> + <> <> - <> + <> <> - <> + <> <> <> <> @@ -106,17 +102,8 @@ position: 3124,-2048 <> <> <> -<> -<> -<> -=== -title: OpenMemoryView -tags: -position: 3248,-1802 ---- -<> -<> === + // title: IntoMemoryView // tags: // position: 268,-629 @@ -166,7 +153,7 @@ title: Eye_poster position: 2132,-1801 --- <> -<> +<> <> <> 日志:未知进程,正在从记忆非法写入,打印记忆卡... @@ -178,7 +165,7 @@ title: Eye_plant position: 1890,-1811 --- <> -<> +<> <> <> 日志:未知进程,正在从记忆非法写入,打印记忆卡... @@ -190,8 +177,9 @@ position: 1890,-1811 title: EndCheck position: 2129,-1217 --- -<> +<> me:似乎有足够的信息了,我们离开这里吧 +<> <> <> <> diff --git a/Assets/Scripts/FixSystem/Cable/Plug.cs b/Assets/Scripts/FixSystem/Cable/Plug.cs index 49709c4b9..840d7fc81 100644 --- a/Assets/Scripts/FixSystem/Cable/Plug.cs +++ b/Assets/Scripts/FixSystem/Cable/Plug.cs @@ -6,6 +6,7 @@ using System.Linq; using DG.Tweening; using AibisDream; using Yarn.Unity; +using System; public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUpHandler { @@ -32,6 +33,8 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp get { return cableref; } set { cableref = value; } } + public event Action OnPlugInserted; + public event Action OnPlugRemoved; private void Awake() @@ -102,6 +105,7 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp // 通知 DialogueManager 开始拖拽 DialogueManager.Instance.SetDragging(true); currentSocket?.RemovePlug(this); + OnPlugRemoved?.Invoke(); plugSprite.enabled = true; @@ -167,6 +171,7 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp { currentSocket = closestSocket; currentSocket.InsertPlug(this); + OnPlugInserted?.Invoke(this); // 触发插入事件 transform.position = currentSocket.GetPosition(); plugSprite.enabled = false; //transform.rotation = startRotation; @@ -177,6 +182,7 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp { //transform.rotation = startRotation; initialSocket.InsertPlug(this); + OnPlugInserted?.Invoke(this); // 触发插入事件 plugSprite.enabled =false; // Make the plug sprite disappear when it is inserted into the initial socket. }); } diff --git a/Assets/Scripts/FixSystem/Cable/Socket.cs b/Assets/Scripts/FixSystem/Cable/Socket.cs index ef5210c39..8417311f6 100644 --- a/Assets/Scripts/FixSystem/Cable/Socket.cs +++ b/Assets/Scripts/FixSystem/Cable/Socket.cs @@ -1,5 +1,6 @@ using AibisDream; using UnityEngine; +using System; public class Socket : MonoBehaviour, ISocket { @@ -7,18 +8,26 @@ public class Socket : MonoBehaviour, ISocket public Vector2 InsertionPoint => transform.position; private Plug plug=null; private YarnOption _option; - public bool waitYarnCommand=false; + private bool waitYarnCommand = false; + + public bool WaitYarnCommand + { + get { return waitYarnCommand; } + } public bool notAlowedDeep=false; [HideInInspector] public TargetPointData targetData; // 新增属性 + + public YarnOption Option { set => _option = value; } + public void Start() { targetData=transform.GetComponent(); diff --git a/Assets/Scripts/FixSystem/Scope/OscilloscopeController.cs b/Assets/Scripts/FixSystem/Scope/OscilloscopeController.cs index 392382eba..2ba46e830 100644 --- a/Assets/Scripts/FixSystem/Scope/OscilloscopeController.cs +++ b/Assets/Scripts/FixSystem/Scope/OscilloscopeController.cs @@ -8,6 +8,7 @@ using DG.Tweening; using TMPro; using UnityEditor.Localization.Plugins.XLIFF.V20; using AibisDream; +using Yarn.Unity; public class OscilloscopeController : MonoBehaviour { @@ -32,6 +33,8 @@ public class OscilloscopeController : MonoBehaviour public TMP_Text screenText; + private Socket currentSocket; + void Start() { scanLine.startWidth=0.05f; @@ -41,6 +44,7 @@ public class OscilloscopeController : MonoBehaviour plug = FindObjectOfType(); DeepInButton.GetComponent