diff --git a/Assets/Plugins/Febucci/Text Animator/Extra/Typewriter Sound - Package.unitypackage.meta b/Assets/Plugins/Febucci/Text Animator/Extra/Typewriter Sound - Package.unitypackage.meta new file mode 100644 index 000000000..4801b3793 --- /dev/null +++ b/Assets/Plugins/Febucci/Text Animator/Extra/Typewriter Sound - Package.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 560a88da2bbc70140bed167f0ba7fe37 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Febucci/Text Animator/Integrations/PlayMaker - Integration.unitypackage.meta b/Assets/Plugins/Febucci/Text Animator/Integrations/PlayMaker - Integration.unitypackage.meta new file mode 100644 index 000000000..77d64a86c --- /dev/null +++ b/Assets/Plugins/Febucci/Text Animator/Integrations/PlayMaker - Integration.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fb01be13d6e88ca488dda82150319bfc +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Febucci/Text Animator/Integrations/Visual Scripting - Integration.unitypackage.meta b/Assets/Plugins/Febucci/Text Animator/Integrations/Visual Scripting - Integration.unitypackage.meta new file mode 100644 index 000000000..05e590027 --- /dev/null +++ b/Assets/Plugins/Febucci/Text Animator/Integrations/Visual Scripting - Integration.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 117dcc671050f5247bd8743b91ecaab7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prototype/佩佩/Scripts/EyeTransitionManager.cs b/Assets/Prototype/佩佩/Scripts/EyeTransitionManager.cs index 0408d5c91..83dd66e29 100644 --- a/Assets/Prototype/佩佩/Scripts/EyeTransitionManager.cs +++ b/Assets/Prototype/佩佩/Scripts/EyeTransitionManager.cs @@ -1,6 +1,8 @@ -using System; +using System; using System.Collections.Generic; using System.Collections; +using System.Linq; +using AibisDream; using UnityEngine; using UnityEngine.UI; using DG.Tweening; @@ -24,8 +26,9 @@ public class EyeTransitionManager : MonoBehaviour public GameObject viewPanel; // 视图的面板 public Button activateButton; // 视图的激活按钮(MainView除外) public Button returnToMainViewButton; // 视图的返回MainView按钮 - public ViewState viewState; // 视图的状态 public bool isAvailable = true; // 视图是否可用 + public Socket socket; + public ViewState viewState; } // 在 Unity 编辑器中配置视图(不包括MainView) @@ -53,10 +56,14 @@ public class EyeTransitionManager : MonoBehaviour // 视图更改请求的事件 public delegate void ViewChangeRequestedHandler(ViewState targetViewState); + public event ViewChangeRequestedHandler OnViewChangeRequested; private void Start() { + // 首先注册命令 + DialogController.Instance.RegisterOptionCommand("activate_socket_choice", ActivateSocketChoice); + // 初始化视图 InitializeView(); @@ -65,11 +72,6 @@ public class EyeTransitionManager : MonoBehaviour foreach (var config in viewConfigs) { viewConfigDictionary[config.viewState] = config; - if (config.activateButton != null) - { - // 绑定非MainView的视图激活按钮 - config.activateButton.onClick.AddListener(() => StartTransition(config.viewState)); - } if (config.returnToMainViewButton != null) { // 绑定每个视图的返回MainView按钮 @@ -80,6 +82,29 @@ public class EyeTransitionManager : MonoBehaviour } } + public void ActivateSocketChoice(YarnOption[] options) + { + var optionDic = options.ToDictionary(item => item.Text, item => item); + + foreach (var viewConfig in viewConfigs) + { + if (optionDic.ContainsKey(viewConfig.viewState.ToString())) + { + // 为Socket添加方法 + viewConfig.socket.Option = optionDic[viewConfig.viewState.ToString()]; + } + else if (optionDic.ContainsKey(viewConfig.viewState + "Activate")) + { + viewConfig.activateButton.onClick.RemoveAllListeners(); + // 为激活添加方法 + viewConfig.activateButton.onClick.AddListener(() => + { + optionDic[viewConfig.viewState+ "Activate"].SelectOption(); + }); + } + } + } + private void InitializeView() { // 默认激活 MainView diff --git a/Assets/Prototype/佩佩/佩佩视觉模块.unity b/Assets/Prototype/佩佩/佩佩视觉模块.unity index 96c108f2e..8ff5a451a 100644 --- a/Assets/Prototype/佩佩/佩佩视觉模块.unity +++ b/Assets/Prototype/佩佩/佩佩视觉模块.unity @@ -9024,16 +9024,19 @@ MonoBehaviour: - viewPanel: {fileID: 1229487019} activateButton: {fileID: 1887941707} returnToMainViewButton: {fileID: 1700390218} + socket: {fileID: 2031366194} viewState: 1 isAvailable: 1 - viewPanel: {fileID: 1294333830} activateButton: {fileID: 19183081} returnToMainViewButton: {fileID: 2126911511} + socket: {fileID: 7986262} viewState: 2 isAvailable: 1 - viewPanel: {fileID: 1882925196} activateButton: {fileID: 590852443} returnToMainViewButton: {fileID: 254003903} + socket: {fileID: 1451543708} viewState: 3 isAvailable: 1 --- !u!4 &1102365682 @@ -10917,6 +10920,10 @@ PrefabInstance: propertyPath: m_Name value: "\u5927\u8111\u7EF4\u4FEE\u7EC6\u5316(1)" objectReference: {fileID: 0} + - target: {fileID: -8653719598885068355, guid: d8489dc41f8c4c9479ba48d5bf39e02e, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: -7663647160766384332, guid: d8489dc41f8c4c9479ba48d5bf39e02e, type: 3} propertyPath: m_IsActive value: 0 diff --git a/Assets/Resources/Yarn/PeipeiTalk/PeipeiTalk1.yarn b/Assets/Resources/Yarn/PeipeiTalk/PeipeiTalk1.yarn index 4b921acb3..4b36efa15 100644 --- a/Assets/Resources/Yarn/PeipeiTalk/PeipeiTalk1.yarn +++ b/Assets/Resources/Yarn/PeipeiTalk/PeipeiTalk1.yarn @@ -87,32 +87,33 @@ position: 71,-262 <> ///表示记忆模块在当前维修阶段是否已经进入过了 <> + +[command name=activate_socket_choice /] +我: 好的,右边这个黑盒子应该就是UF了,左边这个是她的视觉模块,都检查一下吧。 <> === title: Choice position: 74,-5 --- -<> -我: 好的,右边这个黑盒子应该就是UF了,左边这个是她的视觉模块,都检查一下吧。 -<> -我: 视觉模块的问题很奇怪,还没什么头绪 -我: 佩佩身上的那个UF应该也有问题吧,先去那边检查下吧。 -<> -我: 好,现在UF确认有色彩问题了,她说了眼睛痛吧,也去视觉模块检查下 -<> -我: UF模块和视觉模块的表现都不正常...去记忆模块检查确认下 -<> -我: 我好像明白了 -<> -->检查视觉系统<> - <> -->检查UF模块<> - <> -->检查记忆模块<> - <> -->结束诊断,进行治疗<> - //<> - +[options /] + -> UFView + 插入UF模块 + <> + <> + -> EyeView + 插入Eye模块 + <> + <> + -> MemoryView + 插入Memory模块 + <> + <> + -> UFViewActivate + <> + -> EyeViewActivate + <> + -> MemoryViewActivate + <> === title: EyeView position: 440,16 @@ -149,7 +150,12 @@ WARNING: 无法读取色觉模组。(病症介绍,可能是普遍现象) ///<<任务提示更新:进行色觉检查测试已完成>> ///<<任务提示更新:检查视觉模块已完成>> <> -<> + + <> + <> + <> + <> + <> === title: MainViewUF @@ -179,7 +185,12 @@ position: -324,10 佩佩: 好的,麻烦医生了。 ///标记现在已经访问主视角下的UF模块了 <> + +<> +<> +<> <> +<> === title: MemoryView diff --git a/Assets/Scenes/Persistence.unity b/Assets/Scenes/Persistence.unity index f35f862b7..a3943b5bf 100644 --- a/Assets/Scenes/Persistence.unity +++ b/Assets/Scenes/Persistence.unity @@ -205,9 +205,9 @@ RectTransform: m_Children: [] m_Father: {fileID: 1696845842} 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: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 200, y: -54.599014} m_SizeDelta: {x: 240, y: 80} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &237392156 @@ -1269,7 +1269,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &731599308 RectTransform: m_ObjectHideFlags: 0 @@ -2126,9 +2126,9 @@ RectTransform: m_Children: [] m_Father: {fileID: 1696845842} 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: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 200, y: -163.79704} m_SizeDelta: {x: 240, y: 80} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1596715192 @@ -2420,9 +2420,9 @@ RectTransform: m_Children: [] m_Father: {fileID: 1696845842} 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: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 200, y: -272.99506} m_SizeDelta: {x: 240, y: 80} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1611684201 diff --git a/Assets/Scripts/Dialog System/DialogController.cs b/Assets/Scripts/Dialog System/DialogController.cs index 03f0ace99..c058b6f1a 100644 --- a/Assets/Scripts/Dialog System/DialogController.cs +++ b/Assets/Scripts/Dialog System/DialogController.cs @@ -91,6 +91,7 @@ namespace AibisDream Debug.Log($"命令 {commandName} 已经存在,将被替换"); } + Debug.Log(commandMap == null); commandMap[commandName] = commandAction; } diff --git a/Assets/Scripts/FixSystem/Cable/Cable.cs b/Assets/Scripts/FixSystem/Cable/Cable.cs index 769a17570..a5ffd77e1 100644 --- a/Assets/Scripts/FixSystem/Cable/Cable.cs +++ b/Assets/Scripts/FixSystem/Cable/Cable.cs @@ -26,6 +26,7 @@ public class Cable : MonoBehaviour float t = i / (float)(resolution - 1); points[i] = Vector3.Lerp(start.position, end.position, t); } + lineRenderer.positionCount = resolution; } @@ -51,14 +52,15 @@ public class Cable : MonoBehaviour { Vector3 offsetPrev = (points[i - 1] - points[i]); Vector3 offsetNext = points[i + 1] - points[i]; - Vector3 velocity = offsetPrev.normalized * offsetPrev.magnitude * F + offsetNext.normalized * offsetNext.magnitude * F; + Vector3 velocity = offsetPrev.normalized * offsetPrev.magnitude * F + + offsetNext.normalized * offsetNext.magnitude * F; points[i] += velocity * Time.deltaTime / k; } + for (int i = 1; i < points.Length - 1; i++) { points[i] += Vector3.down * 9.8f * Time.deltaTime / k; } } } - -} +} \ No newline at end of file diff --git a/Assets/Scripts/FixSystem/Cable/ISocket.cs b/Assets/Scripts/FixSystem/Cable/ISocket.cs index 7d716b4af..716434f9e 100644 --- a/Assets/Scripts/FixSystem/Cable/ISocket.cs +++ b/Assets/Scripts/FixSystem/Cable/ISocket.cs @@ -1,13 +1,12 @@ using Unity.VisualScripting; using UnityEngine; + public interface ISocket { bool IsAvailable { get; } Vector2 InsertionPoint { get; } - Vector2 GetPosition(); + Vector2 GetPosition(); void InsertPlug(Plug plug); void RemovePlug(Plug plug); - - -} +} \ No newline at end of file diff --git a/Assets/Scripts/FixSystem/Cable/Plug.cs b/Assets/Scripts/FixSystem/Cable/Plug.cs index 8b60b01e7..db1869da2 100644 --- a/Assets/Scripts/FixSystem/Cable/Plug.cs +++ b/Assets/Scripts/FixSystem/Cable/Plug.cs @@ -13,7 +13,7 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp private ISocket currentSocket = null; private Image image; private Vector3 pickupOffset = new Vector3(0, 0, 0); - private Quaternion pickupRotationOffset = Quaternion.Euler(0, 0, 30); + private Quaternion pickupRotationOffset = Quaternion.Euler(0, 0, 30); public Socket initialSocket; // new variable public Image plugSprite; // new variable @@ -21,11 +21,12 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp { image = GetComponent(); } - private void Start() + + private void Start() { startPosition = initialSocket.GetPosition(); - transform.position=startPosition; + transform.position = startPosition; //startRotation = initialSocket.GetRotation(); // Insert the plug into the initial socket and make the sprite disappear. @@ -33,7 +34,6 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp plugSprite.enabled = false; } - public void OnPointerDown(PointerEventData eventData) { @@ -51,7 +51,8 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp { if (isDragging) { - Vector3 screenPosition = new Vector3(eventData.position.x, eventData.position.y, Camera.main.WorldToScreenPoint(transform.position).z); + Vector3 screenPosition = new Vector3(eventData.position.x, eventData.position.y, + Camera.main.WorldToScreenPoint(transform.position).z); Vector3 move = Camera.main.ScreenToWorldPoint(screenPosition); move.z = transform.position.z; transform.position = move; @@ -84,16 +85,18 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp { currentSocket = closestSocket; currentSocket.InsertPlug(this); - transform.position = currentSocket.GetPosition(); + transform.position = currentSocket.GetPosition(); plugSprite.enabled = false; //transform.rotation = startRotation; } else { - transform.DOMove(startPosition, 0.1f).OnComplete(() => { + transform.DOMove(startPosition, 0.1f).OnComplete(() => + { //transform.rotation = startRotation; initialSocket.InsertPlug(this); - plugSprite.enabled = false; // Make the plug sprite disappear when it is inserted into the initial socket. + plugSprite.enabled = + false; // Make the plug sprite disappear when it is inserted into the initial socket. }); } } @@ -104,4 +107,4 @@ public class Plug : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUp float snappingRange = 1.0f; // You might need to adjust this for WorldSpace Canvas Gizmos.DrawWireSphere(transform.position, snappingRange); } -} +} \ No newline at end of file diff --git a/Assets/Scripts/FixSystem/Cable/Socket.cs b/Assets/Scripts/FixSystem/Cable/Socket.cs index 6c3c35bc0..27abd6572 100644 --- a/Assets/Scripts/FixSystem/Cable/Socket.cs +++ b/Assets/Scripts/FixSystem/Cable/Socket.cs @@ -1,3 +1,4 @@ +using AibisDream; using UnityEngine; public class Socket : MonoBehaviour, ISocket @@ -5,13 +6,24 @@ public class Socket : MonoBehaviour, ISocket public bool IsAvailable { get; private set; } = true; public Vector2 InsertionPoint => transform.position; + private YarnOption _option; + + public YarnOption Option + { + set => _option = value; + } + public void InsertPlug(Plug plug) { + if (IsAvailable) { IsAvailable = false; } + + // 可插入就可以触发对话 + _option?.SelectOption(); } public void RemovePlug(Plug plug) @@ -19,9 +31,9 @@ public class Socket : MonoBehaviour, ISocket IsAvailable = true; } + public Vector2 GetPosition() { return transform.position; } - -} +} \ No newline at end of file