diff --git a/Assets/Resources/Yarn/PeipeiNew/ClueBoard.yarn b/Assets/Resources/Yarn/PeipeiNew/ClueBoard.yarn index 92faabd0f..9b460c448 100644 --- a/Assets/Resources/Yarn/PeipeiNew/ClueBoard.yarn +++ b/Assets/Resources/Yarn/PeipeiNew/ClueBoard.yarn @@ -1,9 +1,23 @@ +title: 检查ClueBoard +tags: +position: 43,-97 +--- +<> + <> +<> + <> +<> + <> +<> +=== + title: UF图像问题回答正确 tags: position: 43,-97 --- me: UF绘图使用的红色应该是在记忆“草地”的引导下调用的 me:而草地记忆出现了glitch,这是因为什么? +<> <> === title: 记忆问题回答正确 @@ -13,12 +27,15 @@ position: 49,-314 me: 草地记忆之所以会发生glitch,是因为记忆调用了它 me: 正常来说应该是视觉去向记忆传递信息,但是现在颜色信息却传递了过来 me:明白了,是记忆反流症 +<> <> <> +<> me:要怎么办呢? me: 看起来只有做记忆-视觉阻断手术了 <> <> +<> === title: 执行手术 tags: diff --git a/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn b/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn index 025e203dd..1a530429c 100644 --- a/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn +++ b/Assets/Resources/Yarn/PeipeiNew/PeipeiNew.yarn @@ -1,7 +1,7 @@ title: Start tags: colorID: 8 -position: 242,-2373 +position: 242,-2376 --- 测试 //NOTE:房间界面的对话都单句写短一些(16字以内,参考CoffeeTalk),维修的可以长一些 @@ -64,12 +64,16 @@ position: 241,-2149 //是否插入过视觉产生的打孔带 <> + +//clueboard相关 +<> +<> <> === title: 引入对话 tags: colorID: 8 -position: 238,-1915 +position: 244,-1783 --- //分支剧情的初始化 diff --git a/Assets/Scripts/Clue/ClueBaordNew.cs b/Assets/Scripts/Clue/ClueBaordNew.cs index b4c1835c4..4d7e6cc4d 100644 --- a/Assets/Scripts/Clue/ClueBaordNew.cs +++ b/Assets/Scripts/Clue/ClueBaordNew.cs @@ -15,6 +15,8 @@ public class ClueBaordNew : MonoBehaviour public Notification ClueBoardNotification; private Dictionary nodePositions = new Dictionary(); + + private Connection currentConnection; void Start() { gm=GetComponent(); @@ -41,30 +43,48 @@ public class ClueBaordNew : MonoBehaviour } - + [YarnCommand("CheckClueBoard")] public void CheckConnection(Connection connection) { + currentConnection=connection; + DialogController.Instance.SetVariable("$StartNode",connection.port0.node.ID); + DialogController.Instance.SetVariable("$EndNode",connection.port1.node.ID); + DialogController.Instance.StartDialogNode("检查ClueBoard"); - if (connection.port0.node.ID == "UFImage" && connection.port1.node.ID == "MemoryGrass") - { - connection.DisableClick=false; - connection.EnableDrag=false; - DialogController.Instance.StartDialogNode("UF图像问题回答正确"); - // GetNode("MemoryGrass").transform.GetChild(1).gameObject.SetActive(true); + + // if (connection.port0.node.ID == "UFImage" && connection.port1.node.ID == "MemoryGrass") + // { + // connection.DisableClick=false; + // connection.EnableDrag=false; + // DialogController.Instance.StartDialogNode("UF图像问题回答正确"); + // // GetNode("MemoryGrass").transform.GetChild(1).gameObject.SetActive(true); - } - if (connection.port0.node.ID == "MemoryGrass" && connection.port1.node.ID == "EyePlant") + // } + // if (connection.port0.node.ID == "MemoryGrass" && connection.port1.node.ID == "EyePlant") + // { + // connection.DisableClick=false; + // connection.EnableDrag=false; + // DialogController.Instance.StartDialogNode("记忆问题回答正确"); + // } + // if (connection.port0.node.ID == "手术" && connection.port1.node.ID == "solution") + // { + // connection.DisableClick=false; + // connection.EnableDrag=false; + // DialogController.Instance.StartDialogNode("执行手术"); + // } + } + [YarnCommand("ConnectionCantBreak")] + public void SetConnectionProperties() + { + if (currentConnection == null) { - connection.DisableClick=false; - connection.EnableDrag=false; - DialogController.Instance.StartDialogNode("记忆问题回答正确"); - } - if (connection.port0.node.ID == "手术" && connection.port1.node.ID == "solution") - { - connection.DisableClick=false; - connection.EnableDrag=false; - DialogController.Instance.StartDialogNode("执行手术"); + Debug.LogWarning("Connection not found."); + return; } + + currentConnection.DisableClick=false; + currentConnection.EnableDrag=false; + currentConnection=null; } diff --git a/Assets/Scripts/Dialog System/DialogController.cs b/Assets/Scripts/Dialog System/DialogController.cs index 4a6edb0ab..f5d60bc79 100644 --- a/Assets/Scripts/Dialog System/DialogController.cs +++ b/Assets/Scripts/Dialog System/DialogController.cs @@ -118,7 +118,11 @@ namespace AibisDream } public void StartDialogNode(string nodeName) { - dialogueRunner.StartDialogue(nodeName); + if(CheckIfNodeExistInCurrentYarnProject(nodeName)) + { + dialogueRunner.StartDialogue(nodeName); + } + } public bool CheckIfNodeExistInCurrentYarnProject(string nodeName)