diff --git a/Assets/Prototype/佩佩/Scripts/MemoryProcess.cs b/Assets/Prototype/佩佩/Scripts/MemoryProcess.cs index c32dc3a26..35a104238 100644 --- a/Assets/Prototype/佩佩/Scripts/MemoryProcess.cs +++ b/Assets/Prototype/佩佩/Scripts/MemoryProcess.cs @@ -5,6 +5,7 @@ using UnityEngine.UI; using DG.Tweening; using Yarn.Unity; using AibisDream; +using Unity.VisualScripting; public class MemoryProcess : MonoBehaviour,IViewLifecycle { @@ -23,9 +24,11 @@ public class MemoryProcess : MonoBehaviour,IViewLifecycle public float targetFrequency = 1.25f; // 目标频率 public float targetClarity = 5.7f; // 目标频率 - private float lockThreshold = 0.05f; // 锁定阈值 + private float lockThreshold = 0.2f; // 锁定阈值 private bool isProcessing = false; // 新增变量来追踪是否正在处理记忆 + + private bool isColorful = false; // private bool isFrequencyFound = false; // 追踪是否找到目标频率 private bool isClarityFound = false; // 追踪是否找到目标清晰度 @@ -84,43 +87,40 @@ public class MemoryProcess : MonoBehaviour,IViewLifecycle { float distance = Mathf.Abs(value - targetFrequency); UpdateShaderParameters(distance); - CheckIfFound(distance, ref isFrequencyFound); + CheckIfFound(distance, ref isFrequencyFound); // 这里更新 isFrequencyFound } - void OnClarityChanged(float value) +void OnClarityChanged(float value) { - // 计算滑块值与目标清晰度之间的距离 float distance = Mathf.Abs(value - targetClarity); - - // 计算滑块值与目标清晰度之间的最大可能距离 float maxDistance = Mathf.Max( Mathf.Abs(claritySlider.maxValue - targetClarity), Mathf.Abs(claritySlider.minValue - targetClarity) ); - - // 归一化距离,确保 t 在 0 到 1 之间,且当滑块值等于目标清晰度时,t 等于 1 float t = Mathf.Clamp01(distance / maxDistance); - - UpdateClarityShaderParameters(t); - CheckIfFound(distance, ref isFrequencyFound); + + UpdateClarityShaderParameters(t); + CheckIfFound(t, ref isClarityFound); // 这里更新 isClarityFound } void OnSearchComplete() { Debug.Log("Memory search completed."); frequencySlider.interactable = false; claritySlider.interactable = false; - //PlayMemory(); + PlayMemory(); } void CheckIfFound(float distance, ref bool isFound) { if (distance < lockThreshold) { isFound = true; + // 检查是否两个条件都满足 if (isFrequencyFound && isClarityFound) { - OnSearchComplete(); + OnSearchComplete(); // 一旦条件满足,调用完成处理 } } } + void UpdateShaderParameters(float distance) { if (processMaterial != null) @@ -174,17 +174,23 @@ public class MemoryProcess : MonoBehaviour,IViewLifecycle } public void Init() { + isFrequencyFound=false; + isClarityFound=false; + isProcessing=false; if (frequencySlider != null) { frequencySlider.onValueChanged.AddListener(OnFrequencyChanged); frequencySlider.gameObject.SetActive(false); frequencySlider.value=3; + frequencySlider.interactable = true; + } if (claritySlider != null) { claritySlider.onValueChanged.AddListener(OnClarityChanged); claritySlider.gameObject.SetActive(false); claritySlider.value=3; + claritySlider.interactable = true; } memoryProcessImage.gameObject.SetActive(true); processMaterial=memoryProcessImage.material; @@ -204,7 +210,6 @@ public class MemoryProcess : MonoBehaviour,IViewLifecycle float t = Mathf.Clamp01(distance / maxDistance); UpdateClarityShaderParameters(t); PunchTape=null; - } [YarnCommand("MemoryFinished")] @@ -224,11 +229,22 @@ public IEnumerator ColorFadeOut() } public void PlayMemory() { - DialogController.Instance.StartDialogNode(PunchTape.ClueName); + processMaterial.SetFloat("_FullAlphaDissolveFade", 0); + memoryMaterial.SetFloat("_PixelateSize", 512); + memoryMaterial.SetFloat("_OffsetUvX", 0); + memoryMaterial.SetFloat("_OffsetUvY", 0); + memoryMaterial.SetFloat("_DistortAmount", 0); + DialogController.Instance.StartDialogNode(clueSlot.punchTape.ClueName); } [YarnCommand("search_memory")] - public IEnumerator SearchMemory(PunchTape punchTape,bool isSearchedBefore=false,bool isColorful = true) + public IEnumerator SearchMemory(PunchTape punchTape,bool isSearchedBefore=false) { + if(punchTape==null) + { + Debug.Log("no punchTape"); + yield break; + } + PunchTape=punchTape; if (isSearchedBefore) { PlayMemory(); @@ -247,21 +263,22 @@ public void PlayMemory() Debug.LogWarning("Already processing a memory. Please wait until the process is finished."); yield break; } - Sprite memorySprite = Resources.Load("Art/Memory/" + punchTape.MemoryIndex); + processedPunchTapes.Add(punchTape,true); + Sprite memorySprite = Resources.Load("Art/Memory/" + PunchTape.MemoryIndex); + memoryFinishedImage.sprite = memorySprite; + memoryFinishedImageNoColor.sprite = memorySprite; if (memorySprite == null) { - Debug.LogError("Memory not found: " + punchTape.MemoryIndex); - yield break; + Debug.LogError("Memory not found: " + PunchTape.MemoryIndex); } - if (isColorful) - { - memoryFinishedImage.material.SetFloat("_DirectionalDistortionFade", -2); - } - else - { - memoryFinishedImage.material.SetFloat("_DirectionalDistortionFade", -14); - } - + // if (isColorful) + // { + // memoryFinishedImage.material.SetFloat("_DirectionalDistortionFade", -2); + // } + // else + // { + // memoryFinishedImage.material.SetFloat("_DirectionalDistortionFade", -14); + // } //AudioManager.PlayLoopAudio("tv_noise"); processMaterial.SetFloat("_StrongTintFade", 0); processMaterial.SetFloat("_GlitchFade", 1); @@ -269,44 +286,7 @@ public void PlayMemory() isProcessing = true; // 开始处理,设置为true frequencySlider.gameObject.SetActive(true); claritySlider.gameObject.SetActive(true); - - Sequence memorySequence = DOTween.Sequence(); - // AudioManager.SetLoopSourceVolume(0.3f); - // AudioManager.PlayLoopAudio("tv_noise"); - //AudioManager.PlayMemoryAudio("mem_"+memoryName); - // 修改memoryprocess的参数 - // memorySequence.Append(memoryProcessImage.material.DOFloat(0, "_StrongTintFade", 0.2f)); - // memorySequence.Join(memoryProcessImage.material.DOFloat(1, "_GlitchFade", 0.2f)); - - //memorySequence.AppendInterval(2.8f); // 添加1.5秒的延时 - - // 在1.5秒延时后,暂停循环音频并播放记忆音频 - // memorySequence.AppendCallback(() => - // { - - // AudioManager.PauseLoopAudio(); - // AudioManager.SetLoopSourceVolume(1.0f); - // AudioManager.PlayMemoryAudio("mem_"+memoryName); - - // }); - - // memorySequence.AppendInterval(3.4f); - - // // 记忆处理结束,激活memoryFinishedImage - // memorySequence.AppendCallback(() => - // { - // memoryProcessImage.gameObject.SetActive(false); - // memoryFinishedImage.gameObject.SetActive(true); - // memoryFinishedImageNoColor.gameObject.SetActive(true); - // memoryFinishedImage.sprite = memorySprite; // 设置记忆处理结束的图片 - // memoryFinishedImageNoColor.sprite = memorySprite; // 设置记忆处理结束的图片 - // }); - - // // 序列完成时更新索引 - // memorySequence.OnComplete(() => - // { - // isProcessing = false; // 处理完成,设置为false - // }); + DG.Tweening.Sequence memorySequence = DOTween.Sequence(); yield return memorySequence.WaitForCompletion(); } diff --git a/Assets/Prototype/佩佩/Scripts/UFmanager.cs b/Assets/Prototype/佩佩/Scripts/UFmanager.cs index 8e299ffb1..9753899e2 100644 --- a/Assets/Prototype/佩佩/Scripts/UFmanager.cs +++ b/Assets/Prototype/佩佩/Scripts/UFmanager.cs @@ -78,7 +78,7 @@ public class UFmanager : MonoBehaviour //mySequence.Append(baseImage.rectTransform.DOMove(endTransform.position, moveAndFadeInTime)); mySequence.Join(photoImage.DOFade(1f, moveAndFadeInTime).SetEase(Ease.InOutQuad)); mySequence.OnComplete(() => { - isShowingPhoto = false; // 动画完成后,重置标志 + //isShowingPhoto = false; // 动画完成后,重置标志 }); // 等待动画完成 @@ -100,5 +100,29 @@ public class UFmanager : MonoBehaviour return photo; } + public void HidePhoto() + { + if (isShowingPhoto) + { + isShowingPhoto = false; // 设置标志,表示照片隐藏正在进行 + + // 直接设置透明度为 0 并禁用照片显示 + Color c = photoImage.color; + c.a = 0f; + photoImage.color = c; + photoImage.gameObject.SetActive(false); // 隐藏照片 + baseImage.gameObject.SetActive(false); // 隐藏底板 + } + } + + [YarnCommand("hide_photo")] + public void HidePhotoYarnCommand() + { + HidePhoto(); + } + + + // ...其他方法和逻辑 } + diff --git a/Assets/Prototype/佩佩/佩佩视觉模块.unity b/Assets/Prototype/佩佩/佩佩视觉模块.unity index 2d689d9b0..e1e49993b 100644 --- a/Assets/Prototype/佩佩/佩佩视觉模块.unity +++ b/Assets/Prototype/佩佩/佩佩视觉模块.unity @@ -626,6 +626,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: + waitYarnCommand: 1 + notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &7986263 MonoBehaviour: @@ -2737,6 +2739,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: + waitYarnCommand: 0 + notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &144553464 MonoBehaviour: @@ -6191,11 +6195,12 @@ MonoBehaviour: m_GameObject: {fileID: 241874895} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 092522a3461fc814a8b9337827332dc4, type: 3} + m_Script: {fileID: 11500000, guid: 08ace7d1cbb872b49a73a914f1f93b10, type: 3} m_Name: m_EditorClassIdentifier: - expectedClueType: 0 + currentClueItem: {fileID: 0} isOccupied: 0 + isLocked: 0 --- !u!1 &253867294 GameObject: m_ObjectHideFlags: 0 @@ -6383,6 +6388,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: + waitYarnCommand: 1 + notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &265611527 MonoBehaviour: @@ -6628,107 +6635,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &273778558 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 273778559} - - component: {fileID: 273778562} - - component: {fileID: 273778561} - - component: {fileID: 273778560} - m_Layer: 5 - m_Name: NameCanvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &273778559 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 273778558} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.0752689, y: 1.0752689, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 1082705360} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 5.376344} - m_SizeDelta: {x: 16, y: 9} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &273778560 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 273778558} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &273778561 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 273778558} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 1 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 1 ---- !u!223 &273778562 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 273778558} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_VertexColorAlwaysGammaSpace: 0 - m_AdditionalShaderChannelsFlag: 25 - m_UpdateRectTransformForStandalone: 0 - m_SortingLayerID: 349519991 - m_SortingOrder: 5 - m_TargetDisplay: 0 --- !u!1 &281630714 GameObject: m_ObjectHideFlags: 0 @@ -7036,8 +6942,10 @@ GameObject: - component: {fileID: 295548112} - component: {fileID: 295548114} - component: {fileID: 295548113} + - component: {fileID: 295548116} + - component: {fileID: 295548115} m_Layer: 0 - m_Name: "\u60C5\u7EEA\u6A21\u5757 (1)" + m_Name: EmoView m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -7126,6 +7034,63 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!114 &295548115 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 295548111} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 602eb1c35172a264099ff28df4f1bdc8, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!61 &295548116 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 295548111} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1.32, y: 1.1} + newSize: {x: 0.89, y: 0.7} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1.32, y: 1.1} + m_EdgeRadius: 0 --- !u!1 &298503006 GameObject: m_ObjectHideFlags: 0 @@ -10115,7 +10080,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2064460273118752238, guid: ab166642babe53e4993fa1bd9bd57204, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2064460273118752238, guid: ab166642babe53e4993fa1bd9bd57204, type: 3} propertyPath: m_AnchorMin.x @@ -10123,7 +10088,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2064460273118752238, guid: ab166642babe53e4993fa1bd9bd57204, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2064460273118752238, guid: ab166642babe53e4993fa1bd9bd57204, type: 3} propertyPath: m_SizeDelta.x @@ -10163,11 +10128,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2064460273118752238, guid: ab166642babe53e4993fa1bd9bd57204, type: 3} propertyPath: m_AnchoredPosition.x - value: 180 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2064460273118752238, guid: ab166642babe53e4993fa1bd9bd57204, type: 3} propertyPath: m_AnchoredPosition.y - value: -25 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2064460273118752238, guid: ab166642babe53e4993fa1bd9bd57204, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -10467,6 +10432,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: + waitYarnCommand: 0 + notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &585617292 MonoBehaviour: @@ -13322,6 +13289,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: + waitYarnCommand: 0 + notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &697311005 MonoBehaviour: @@ -14636,7 +14605,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3083274345920604345, guid: 2cec9b064a8a95f41ba830d25ea87d2e, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3083274345920604345, guid: 2cec9b064a8a95f41ba830d25ea87d2e, type: 3} propertyPath: m_AnchorMin.x @@ -14652,7 +14621,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3083274347384374709, guid: 2cec9b064a8a95f41ba830d25ea87d2e, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3083274347408712451, guid: 2cec9b064a8a95f41ba830d25ea87d2e, type: 3} propertyPath: m_Name @@ -16083,8 +16052,10 @@ GameObject: - component: {fileID: 951186777} - component: {fileID: 951186779} - component: {fileID: 951186778} + - component: {fileID: 951186781} + - component: {fileID: 951186780} m_Layer: 0 - m_Name: "\u8BB0\u5FC6\u6A21\u5757 (1)" + m_Name: MemoryView m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -16173,6 +16144,63 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!61 &951186780 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 951186776} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1.54, y: 1.14} + newSize: {x: 1.54, y: 1.14} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1.54, y: 1.14} + m_EdgeRadius: 0 +--- !u!114 &951186781 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 951186776} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 602eb1c35172a264099ff28df4f1bdc8, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &960673425 GameObject: m_ObjectHideFlags: 0 @@ -17243,6 +17271,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: + waitYarnCommand: 0 + notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &1079123348 MonoBehaviour: @@ -17419,7 +17449,6 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1652508981} - - {fileID: 273778559} - {fileID: 2097798907} - {fileID: 1244002772} - {fileID: 295548112} @@ -18887,6 +18916,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: + waitYarnCommand: 1 + notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &1177703836 MonoBehaviour: @@ -20097,8 +20128,10 @@ GameObject: - component: {fileID: 1244002772} - component: {fileID: 1244002774} - component: {fileID: 1244002773} + - component: {fileID: 1244002776} + - component: {fileID: 1244002775} m_Layer: 0 - m_Name: "\u601D\u7EF4\u6A21\u5757 (1)" + m_Name: LogicView m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -20187,6 +20220,63 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!114 &1244002775 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1244002771} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 602eb1c35172a264099ff28df4f1bdc8, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!61 &1244002776 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1244002771} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1.32, y: 1.11} + newSize: {x: 0.89, y: 0.7} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1.32, y: 1.11} + m_EdgeRadius: 0 --- !u!21 &1251634411 Material: serializedVersion: 8 @@ -20615,6 +20705,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: + waitYarnCommand: 0 + notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &1261765724 MonoBehaviour: @@ -23758,6 +23850,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: + waitYarnCommand: 1 + notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &1451543709 MonoBehaviour: @@ -23810,7 +23904,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: waveformType: 0 - isCorrect: 0 + isCorrect: 1 randomShift: 0 initialRandomPhase: 0 spikeIndex: -1 @@ -27697,8 +27791,10 @@ GameObject: - component: {fileID: 1715975300} - component: {fileID: 1715975302} - component: {fileID: 1715975301} + - component: {fileID: 1715975304} + - component: {fileID: 1715975303} m_Layer: 0 - m_Name: "\u5DE6\u773C (1)" + m_Name: LeftEyeView m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -27787,6 +27883,63 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!114 &1715975303 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1715975299} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 602eb1c35172a264099ff28df4f1bdc8, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!61 &1715975304 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1715975299} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 0.99, y: 1.08} + newSize: {x: 0.99, y: 1.08} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 0.99, y: 1.08} + m_EdgeRadius: 0 --- !u!21 &1720709099 Material: serializedVersion: 8 @@ -28522,8 +28675,10 @@ GameObject: - component: {fileID: 1738809421} - component: {fileID: 1738809423} - component: {fileID: 1738809422} + - component: {fileID: 1738809425} + - component: {fileID: 1738809424} m_Layer: 0 - m_Name: "\u53F3\u773C (1)" + m_Name: RightEyeView m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -28612,6 +28767,63 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!114 &1738809424 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1738809420} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 602eb1c35172a264099ff28df4f1bdc8, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!61 &1738809425 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1738809420} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 0.99, y: 1.08} + newSize: {x: 0.99, y: 1.08} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 0.99, y: 1.08} + m_EdgeRadius: 0 --- !u!1 &1749292993 GameObject: m_ObjectHideFlags: 0 @@ -31499,7 +31711,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1882925197 RectTransform: m_ObjectHideFlags: 0 @@ -33886,7 +34098,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!4 &2027266814 Transform: m_ObjectHideFlags: 0 @@ -33956,6 +34168,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2a37d0f43cb6f14c8011e55a756c448, type: 3} m_Name: m_EditorClassIdentifier: + waitYarnCommand: 0 + notAlowedDeep: 0 targetData: {fileID: 0} --- !u!114 &2031366195 MonoBehaviour: @@ -34862,8 +35076,10 @@ GameObject: - component: {fileID: 2097798907} - component: {fileID: 2097798909} - component: {fileID: 2097798908} + - component: {fileID: 2097798911} + - component: {fileID: 2097798910} m_Layer: 0 - m_Name: "\u8BB2\u8BDD\u6A21\u5757 (1)" + m_Name: SpeakView m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -34952,6 +35168,63 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!114 &2097798910 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2097798906} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 602eb1c35172a264099ff28df4f1bdc8, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!61 &2097798911 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2097798906} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1.13, y: 0.75} + newSize: {x: 1.01, y: 0.67} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1.13, y: 0.75} + m_EdgeRadius: 0 --- !u!21 &2098166914 Material: serializedVersion: 8 diff --git a/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn b/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn index a812a38ad..1b722c8c9 100644 --- a/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn +++ b/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn @@ -1,29 +1,79 @@ title: Start tags: -position: 642,-710 +position: 298,-2552 --- +新闻:balbalbal <> // <> -// <> -// <> +<> +<> +<> +//<> +<> +<> // //<> // <> +//初始化 +<> +=== +title: 日常对话 +tags: +position: 298,-2251 +--- +peipei:我生病了 +me:开始治疗吧 +<> +=== +title: 诊断 +tags: +position: 300,-1928 +--- + <> + //<> + <> === -title: memoryTest +title: 交互_A tags: -position: 642,-710 +position: -712,-1831 --- -<> -<> -me:放入记忆打孔带 -<> +me:AAAAA === +title: 交互_B +tags: +position: -438,-1831 +--- +me:BBBBBB +=== + + +title: 结论 +tags: +position: 299,-1365 +--- +peipei:佩佩需要手术 +<> +=== +title: 手术 +tags: +position: 298,-1066 +--- +->手术 +me:完成 +<> +=== +title: 流程结束 +tags: +position: 298,-771 +--- +me:再见佩佩 +=== + title: Eye_sky tags: -position: -345,136 +position: 1651,-1810 --- <> <> @@ -31,7 +81,7 @@ position: -345,136 === title: IntoEyeView tags: -position: 91,-240 +position: 2127,-2063 --- <> <> @@ -48,9 +98,48 @@ position: 91,-240 <> <> +=== +title: DeepInView +tags: +position: 3124,-2048 +--- +<> +<> +<> +<> +<> +<> +=== +title: OpenMemoryView +tags: +position: 3248,-1802 +--- +<> +<> +=== +// title: IntoMemoryView +// tags: +// position: 268,-629 +// --- +// <> +// <> +// <> +// <> +// <> +// <> +// <> + +// === +title: UFImageGenerate +position: 3005,-1804 +--- +me:生成UF图 +<> +<> +<> === title: FirstDialogue -position: 406,137 +position: 2358,-1802 --- me:佩佩,你怎么看到的是黑白的 peipei:不用为我担心 @@ -61,111 +150,86 @@ peipei:我小时候,经常透过窗户看蓝天 <> me:啊,出现错误抖动了 日志:未知进程,正在从记忆非法写入,打印记忆卡... -<> +<> me:好了,我要再做几次检查 <> === title: Eye_computer -position: 691,144 +position: 2596,-1801 --- me:这个没有生成颜色,奇怪... <> === title: Eye_poster -position: 141,134 +position: 2132,-1801 --- +<> <> <> <> 日志:未知进程,正在从记忆非法写入,打印记忆卡... -<> +<> <> + <> === title: Eye_plant -position: -105,134 +position: 1890,-1811 --- +<> <> <> <> 日志:未知进程,正在从记忆非法写入,打印记忆卡... -<> +<> <> +<> +< === title: EndCheck -position: 164,530 +position: 2129,-1217 --- <> me:似乎有足够的信息了,我们离开这里吧 -<> +<> <> <> === -title: mem_sky -position: 1049,128 ---- -<> -<> -<> -<> -peipei_child: 医生!看,大象! -docter: 哪里有?…啊,那朵云呀。确实很像大象喔。 -docter: 但是佩佩为什么会见过大象呢? -peipei_child: 我在博物馆见过!好大好大的大象标本,有个哥哥跟我说,大象可以比房子还大! -docter: 佩佩是个很有想象力的小朋友噢。 -peipei_child: 想象力…是什么? -docter: 我们的大脑里面有一个区域专门控制视觉,但是这个区域也控制想象力。 -<> -docter: 佩佩以后会成为一个艺术家的。 -peipei_child: 艺术家又是什么? -<> -peipei_child: 医生快看,它现在更像一个飞机啦! -<> -<> -=== -title: mem_poster -position: 1349,131 ---- -<> -<> -unknown: 好美啊。 -peipei: 嘘,别说话。 -<> -unknown: 我们要是能一直坐在这儿就好了。 -peipei: 都让你别说话。 -<> -unknown: 我爱你。 -<> -<> -=== -title: mem_plant -position: 1666,131 ---- -<> -<> -peipei: 要是工作也能画画…要是能永远画画就好了。 -同学: 哈哈,可能等我们进入公司就不这么觉得了。听说进公司之后做什么都不会再快乐了。 -peipei: 不会的。至少画画这件事情让我感觉到很纯粹的快乐…… -peipei: 那种朝九晚五,一眼看到头的生活,我想我反而会受不了的。 -同学: 哈哈…… -同学: 但愿你是对的。 -peipei: 我肯定是对的。 -<> -peipei: 如果公司这么讨厌的话,我就不在那里干就好了啊! -<> -=== title: End_memoryPaly -position: 1666,131 +position: 1060,-1244 --- <> +<> +me:似乎该看的都看了,我们退出记忆吧 +<> + +<> +=== +title: 主维修界面 +position: 1613,-579 +--- +<> +<> +me:似乎该检查的都检查了,应该去看下诊疗单了 +<> +me:我们应该去记忆看看 +<> +//<> +=== +title: 检查是否完成诊疗单 +position: 302,-1619 +--- +<> +<> +<> + === title: 天空 -position: 1049,128 +position: 801,-1806 --- -<> <> peipei_child: 医生!看,大象! docter: 哪里有?…啊,那朵云呀。确实很像大象喔。 @@ -180,12 +244,16 @@ peipei_child: 艺术家又是什么? <> peipei_child: 医生快看,它现在更像一个飞机啦! <> +<> +<> +me:好了,这个记录下吧 +<> +<> <> === title: 海报 -position: 1349,131 +position: 1058,-1807 --- -<> <> unknown: 好美啊。 peipei: 嘘,别说话。 @@ -195,13 +263,17 @@ peipei: 都让你别说话。 <> unknown: 我爱你。 <> +<> +<> +me:好了,这个记录下吧 +<> +<> <> === title: 植物 -position: 1666,131 +position: 1311,-1807 --- -<> <> peipei: 要是工作也能画画…要是能永远画画就好了。 同学: 哈哈,可能等我们进入公司就不这么觉得了。听说进公司之后做什么都不会再快乐了。 @@ -212,5 +284,20 @@ peipei: 那种朝九晚五,一眼看到头的生活,我想我反而会受不 peipei: 我肯定是对的。 <> peipei: 如果公司这么讨厌的话,我就不在那里干就好了啊! +<> +<> +me:好了,这个记录下吧 +<> +<> <> +=== +title: EmoViewDialogue +position: 1311,-1807 +--- +me:情绪平稳 +=== +title: SpeakViewDialogue +position: 1311,-1807 +--- +me:讲话清晰 === \ No newline at end of file diff --git a/Assets/Scenes/Persistence.unity b/Assets/Scenes/Persistence.unity index 48b195956..255756ac1 100644 --- a/Assets/Scenes/Persistence.unity +++ b/Assets/Scenes/Persistence.unity @@ -2687,6 +2687,8 @@ Transform: - {fileID: 886733272} - {fileID: 40915750} - {fileID: 442870838} + - {fileID: 2000641911} + - {fileID: 1445926171} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1015707783 @@ -3700,6 +3702,50 @@ AudioSource: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 +--- !u!1 &1445926170 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1445926171} + - component: {fileID: 1445926172} + m_Layer: 0 + m_Name: DialogueManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1445926171 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1445926170} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1009826577} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1445926172 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1445926170} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 137399fe5d21cff4bb22cf397fc79303, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1450136609 GameObject: m_ObjectHideFlags: 0 @@ -4053,7 +4099,7 @@ Canvas: m_AdditionalShaderChannelsFlag: 25 m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 - m_SortingOrder: 5 + m_SortingOrder: 7 m_TargetDisplay: 0 --- !u!224 &1604842429 RectTransform: @@ -4977,6 +5023,53 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 98b5d94e03211a94bba6de692a1d405a, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &2000641910 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2000641911} + - component: {fileID: 2000641912} + m_Layer: 0 + m_Name: MouseCursorManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2000641911 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2000641910} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1009826577} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2000641912 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2000641910} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1e6c0eb9d6f3314ca3abcecd44b467d, type: 3} + m_Name: + m_EditorClassIdentifier: + dialogueCursor: {fileID: 2800000, guid: 4fbbbc0b2dc43b54c89198e59aaf1f26, type: 3} + collectCursor: {fileID: 0} + pickupCursor: {fileID: 0} --- !u!1 &2038437601 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Clue/ClueBoardManager.cs b/Assets/Scripts/Clue/ClueBoardManager.cs index 2cb41fec3..df11072ee 100644 --- a/Assets/Scripts/Clue/ClueBoardManager.cs +++ b/Assets/Scripts/Clue/ClueBoardManager.cs @@ -114,7 +114,8 @@ public class ClueBoardManager : MonoBehaviour } else { - conclue.text="完成分析"; + conclue.text="完成分析"; + DialogController.Instance.StartDialogNode("结论"); Debug.Log("All steps completed. Puzzle is solved!"); } } diff --git a/Assets/Scripts/Clue/ClueManager.cs b/Assets/Scripts/Clue/ClueManager.cs index c228515db..04896b14f 100644 --- a/Assets/Scripts/Clue/ClueManager.cs +++ b/Assets/Scripts/Clue/ClueManager.cs @@ -17,18 +17,18 @@ public class ClueManager : MonoBehaviour } void Update() { - if(Input.GetKeyDown(KeyCode.U)) - { - GenerateUFClue("错误绘制","UFView","can_grass_error","绿色"); - } - if(Input.GetKeyDown(KeyCode.M)) - { - GenerateMemoryClue("草地","MemoryView","liuying1-2","绿色"); - } - if(Input.GetKeyDown(KeyCode.V)) - { - GeneratePunchTape("植物","EyeView","天空","绿色"); - } + // if(Input.GetKeyDown(KeyCode.U)) + // { + // GenerateUFClue("错误绘制","UFView","can_grass_error","绿色"); + // } + // if(Input.GetKeyDown(KeyCode.M)) + // { + // GenerateMemoryClue("草地","MemoryView","liuying1-2","绿色"); + // } + // if(Input.GetKeyDown(KeyCode.V)) + // { + // GeneratePunchTape("植物","EyeView","天空","绿色"); + // } // if(Input.GetKeyDown(KeyCode.E)) // { // GenerateImageClue("错误绘制","UFView","can_grass_error"); @@ -62,7 +62,7 @@ public class ClueManager : MonoBehaviour } //用于生成打孔带的函数 [YarnCommand("generate_PunchTape")] - public void GeneratePunchTape(string clueName, string category, string memoryIndex,string mathCode) + public void GeneratePunchTape(string clueName, string category, string memoryIndex,string mathCode=null) { PunchTape punchTape = new PunchTape(category, clueName, memoryIndex,mathCode); GameObject clueGO = Instantiate(punchTapecluePrefab, canvas.transform); @@ -71,19 +71,19 @@ public class ClueManager : MonoBehaviour clueItem.Setup(punchTape); } [YarnCommand("generate_UFClue")] - public void GenerateUFClue(string clueName, string category, string imageName,string mathCode) + public void GenerateUFClue(string clueName, string imageName,string mathCode) { Sprite UFSprite = Resources.Load("Art/Photos/" + imageName); - ImageClue imageClue=new ImageClue(category, clueName, UFSprite,mathCode); + ImageClue imageClue=new ImageClue("UFView", clueName, UFSprite,mathCode); GameObject clueGO = Instantiate(imageCluePrefab, canvas.transform); ClueItem clueItem = clueGO.GetComponent(); clueItem.Setup(imageClue); } - - public void GenerateMemoryClue(string clueName, string category, string imageName,string mathCode) + [YarnCommand("generate_MemoryClue")] + public void GenerateMemoryClue(string clueName, string imageName,string mathCode) { Sprite UFSprite = Resources.Load("Art/Memory/" + imageName); - ImageClue imageClue=new ImageClue(category, clueName, UFSprite,mathCode); + ImageClue imageClue=new ImageClue("MemoryView", clueName, UFSprite,mathCode); GameObject clueGO = Instantiate(imageCluePrefab, canvas.transform); ClueItem clueItem = clueGO.GetComponent(); clueItem.Setup(imageClue); diff --git a/Assets/Scripts/Clue/MemoryClueSlot.cs b/Assets/Scripts/Clue/MemoryClueSlot.cs index 0dd94b202..6e595a807 100644 --- a/Assets/Scripts/Clue/MemoryClueSlot.cs +++ b/Assets/Scripts/Clue/MemoryClueSlot.cs @@ -3,13 +3,14 @@ using UnityEngine; public class MemoryClueSlot : ClueSlotBase { private MemoryProcess memoryManager; - private PunchTape punchTape; + [HideInInspector] + public PunchTape punchTape; protected override void Start() { base.Start(); // 初始化基类中的内容 memoryManager = FindObjectOfType(); - expectedClueType=ClueType.ImageClue; + expectedClueType=ClueType.PunchTape; } // 重写基类的 OnClueInserted 方法,处理播放记忆的逻辑 diff --git a/Assets/Scripts/Dialog System/DialogController.cs b/Assets/Scripts/Dialog System/DialogController.cs index dbcbb74c6..ba9cec855 100644 --- a/Assets/Scripts/Dialog System/DialogController.cs +++ b/Assets/Scripts/Dialog System/DialogController.cs @@ -113,7 +113,24 @@ namespace AibisDream } public void StartDialogNode(string nodeName) { - dialogueRunner.StartDialogue(nodeName); + dialogueRunner.StartDialogue(nodeName); + } + + public bool CheckIfNodeExistInCurrentYarnProject(string nodeName) + { + YarnProject currentProject = dialogueRunner.yarnProject; + string[] nodeNames = currentProject.NodeNames; + if (Array.Exists(nodeNames, name => name == nodeName)) + { + return true; + + } + else + { + Debug.Log($"节点 {nodeName} 不存在!"); + return false; + } + } /// diff --git a/Assets/Scripts/DialogueInteract.meta b/Assets/Scripts/DialogueInteract.meta new file mode 100644 index 000000000..417363a56 --- /dev/null +++ b/Assets/Scripts/DialogueInteract.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9188f88eac24a824c82dffc844125cb4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/FixSystem/Cable/Plug.cs b/Assets/Scripts/FixSystem/Cable/Plug.cs index 83cca0ebc..49709c4b9 100644 --- a/Assets/Scripts/FixSystem/Cable/Plug.cs +++ b/Assets/Scripts/FixSystem/Cable/Plug.cs @@ -9,6 +9,9 @@ using Yarn.Unity; public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUpHandler { + public delegate void PlugEventHandler(Plug plug); + public event PlugEventHandler OnPlugStartDrag; + public event PlugEventHandler OnPlugEndDrag; private Vector3 startPosition; private Quaternion startRotation; private bool isDragging = false; @@ -96,6 +99,8 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp } isDragging = true; image.raycastTarget = false; + // 通知 DialogueManager 开始拖拽 + DialogueManager.Instance.SetDragging(true); currentSocket?.RemovePlug(this); plugSprite.enabled = true; @@ -138,6 +143,8 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp } isDragging = false; image.raycastTarget = true; + // 通知 DialogueManager 结束拖拽 + DialogueManager.Instance.SetDragging(false); float closestDistance = Mathf.Infinity; Socket closestSocket = null; diff --git a/Assets/Scripts/FixSystem/Cable/Socket.cs b/Assets/Scripts/FixSystem/Cable/Socket.cs index 3f60c692b..ef5210c39 100644 --- a/Assets/Scripts/FixSystem/Cable/Socket.cs +++ b/Assets/Scripts/FixSystem/Cable/Socket.cs @@ -7,6 +7,9 @@ public class Socket : MonoBehaviour, ISocket public Vector2 InsertionPoint => transform.position; private Plug plug=null; private YarnOption _option; + public bool waitYarnCommand=false; + + public bool notAlowedDeep=false; [HideInInspector] public TargetPointData targetData; // 新增属性 diff --git a/Assets/Scripts/FixSystem/Scope/OscilloscopeController.cs b/Assets/Scripts/FixSystem/Scope/OscilloscopeController.cs index 958382d82..392382eba 100644 --- a/Assets/Scripts/FixSystem/Scope/OscilloscopeController.cs +++ b/Assets/Scripts/FixSystem/Scope/OscilloscopeController.cs @@ -7,6 +7,7 @@ using System.Text.RegularExpressions; using DG.Tweening; using TMPro; using UnityEditor.Localization.Plugins.XLIFF.V20; +using AibisDream; public class OscilloscopeController : MonoBehaviour { @@ -44,7 +45,7 @@ public class OscilloscopeController : MonoBehaviour } public void DeepIn() -{ + { if (plug == null) { Debug.Log("未找到插头"); @@ -62,10 +63,15 @@ public class OscilloscopeController : MonoBehaviour string originalString = currentSocket.name; string trimmedString = originalString.Replace("Socket", ""); - - - - StartCoroutine(ScanForError(trimmedString)); // 启动扫描协程 + if(!currentSocket.waitYarnCommand) + { + StartCoroutine(ScanForError(trimmedString)); // 启动扫描协程 + } + else + { + DialogController.Instance.SetVariable("$ViewToDeepIn",trimmedString); + DialogController.Instance.StartDialogNode("DeepInView"); + } } private IEnumerator ScanForError(string trimmedString) diff --git a/Assets/Scripts/Mouse.meta b/Assets/Scripts/Mouse.meta new file mode 100644 index 000000000..7e307d2b0 --- /dev/null +++ b/Assets/Scripts/Mouse.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 528437a070ee56649983e46c1f0d34ed +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Mouse/DialogueInteractable.cs b/Assets/Scripts/Mouse/DialogueInteractable.cs new file mode 100644 index 000000000..04242f892 --- /dev/null +++ b/Assets/Scripts/Mouse/DialogueInteractable.cs @@ -0,0 +1,44 @@ +using AibisDream; +using UnityEngine; +using UnityEngine.EventSystems; +using Yarn.Unity; + +public class DialogueInteractable : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler +{ + public Texture2D hoverCursor; // 鼠标悬停时的光标 + + public void OnPointerEnter(PointerEventData eventData) + { + // 通知管理器设置光标 + DialogueManager.Instance.OnInteractableHover(this, true); + } + + public void OnPointerExit(PointerEventData eventData) + { + // 通知管理器重置光标 + DialogueManager.Instance.OnInteractableHover(this, false); + } + + public void OnPointerClick(PointerEventData eventData) + { + // 通知管理器尝试触发对话 + DialogueManager.Instance.TryTriggerDialogue(this); + } + private void OnMouseEnter() + { + // 用于处理 Sprite 的悬停事件 + DialogueManager.Instance.OnInteractableHover(this, true); + } + + private void OnMouseExit() + { + // 用于处理 Sprite 的离开事件 + DialogueManager.Instance.OnInteractableHover(this, false); + } + + private void OnMouseDown() + { + // 用于处理 Sprite 的点击事件 + DialogueManager.Instance.TryTriggerDialogue(this); + } +} \ No newline at end of file diff --git a/Assets/Scripts/Mouse/DialogueInteractable.cs.meta b/Assets/Scripts/Mouse/DialogueInteractable.cs.meta new file mode 100644 index 000000000..0df82f6cc --- /dev/null +++ b/Assets/Scripts/Mouse/DialogueInteractable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 602eb1c35172a264099ff28df4f1bdc8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Mouse/DialogueManager.cs b/Assets/Scripts/Mouse/DialogueManager.cs new file mode 100644 index 000000000..816ec0823 --- /dev/null +++ b/Assets/Scripts/Mouse/DialogueManager.cs @@ -0,0 +1,61 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using AibisDream; + +public class DialogueManager : MonoBehaviour +{ + public static DialogueManager Instance { get; private set; } + private bool isDragging = false; // 用于跟踪是否正在拖拽 + + private void Awake() + { + // 检查是否已有实例 + if (Instance != null && Instance != this) + { + Destroy(gameObject); // 确保只有一个实例存在 + return; + } + + Instance = this; + DontDestroyOnLoad(gameObject); // 防止在场景切换时销毁该对象 + } + + + public void OnInteractableHover(DialogueInteractable interactable, bool isHovering) + { + if (isDragging) + return; // 如果正在拖拽,不进行光标更改 + + if (isHovering) + { + // 设置悬停光标 + MouseCursorManager.Instance.SetCursor(MouseCursorManager.Instance.dialogueCursor); + } + else + { + // 重置光标 + MouseCursorManager.Instance.ResetCursor(); + } + } + + public void TryTriggerDialogue(DialogueInteractable interactable) + { + if (isDragging) + return; // 如果正在拖拽,不触发对话 + + // 构建对话节点名称:游戏对象名称 + "dialogue" + string dialogueNode = interactable.gameObject.name + "Dialogue"; + + // 检查节点是否存在并触发对话 + if(DialogController.Instance.CheckIfNodeExistInCurrentYarnProject(dialogueNode)) + { + DialogController.Instance.StartDialogNode(dialogueNode); + } + } + + public void SetDragging(bool dragging) + { + isDragging = dragging; // 设置拖拽状态 + } +} \ No newline at end of file diff --git a/Assets/Scripts/Mouse/DialogueManager.cs.meta b/Assets/Scripts/Mouse/DialogueManager.cs.meta new file mode 100644 index 000000000..1792ed924 --- /dev/null +++ b/Assets/Scripts/Mouse/DialogueManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 137399fe5d21cff4bb22cf397fc79303 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Mouse/MouseCursorManager.cs b/Assets/Scripts/Mouse/MouseCursorManager.cs new file mode 100644 index 000000000..b464f5ab7 --- /dev/null +++ b/Assets/Scripts/Mouse/MouseCursorManager.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +public class MouseCursorManager : MonoBehaviour +{ + public static MouseCursorManager Instance { get; private set; } + + public Texture2D dialogueCursor; // 对话光标 + public Texture2D collectCursor; // 收藏光标 + public Texture2D pickupCursor; // 拾取光标 + + private Texture2D defaultCursor; // 默认光标 + + private void Awake() + { + // 检查是否已有实例 + if (Instance != null && Instance != this) + { + Destroy(gameObject); // 确保只有一个实例存在 + return; + } + + Instance = this; + DontDestroyOnLoad(gameObject); // 防止在场景切换时销毁该对象 + } + + private void Start() + { + // 将默认光标设置为系统默认光标 + defaultCursor = null; // 可以在这里赋值为 null,或者自定义光标的纹理 + ResetCursor(); + } + + // 设置自定义光标 + public void SetCursor(Texture2D cursorTexture) + { + Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto); + } + + // 重置为默认光标 + public void ResetCursor() + { + Cursor.SetCursor(defaultCursor, Vector2.zero, CursorMode.Auto); + } +} diff --git a/Assets/Scripts/Mouse/MouseCursorManager.cs.meta b/Assets/Scripts/Mouse/MouseCursorManager.cs.meta new file mode 100644 index 000000000..e3c9f1d0d --- /dev/null +++ b/Assets/Scripts/Mouse/MouseCursorManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b1e6c0eb9d6f3314ca3abcecd44b467d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: