From 0a5efac6bd145a08ecd42fb1f1b08d6959e594df Mon Sep 17 00:00:00 2001 From: bottlefish <781230111@qq.com> Date: Tue, 10 Sep 2024 20:51:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B9=A6=E7=9A=84=E9=A1=B5?= =?UTF-8?q?=E6=95=B0=E6=98=AF=E5=A5=87=E6=95=B0=E4=BC=9A=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scenes/Persistence.unity | 8 ++++++-- Assets/Scripts/FixSystem/Book/BookManager.cs | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Assets/Scenes/Persistence.unity b/Assets/Scenes/Persistence.unity index 37172b4b9..1038cdc30 100644 --- a/Assets/Scenes/Persistence.unity +++ b/Assets/Scenes/Persistence.unity @@ -1339,7 +1339,7 @@ MonoBehaviour: runMode: 0 firstTalkSO: {fileID: 11400000, guid: 10601ce26230723479d875a630f15732, type: 2} clinicScene: ClinicScene - testYarnProject: PeipeiTalk2 + testYarnProject: Book --- !u!4 &719228339 Transform: m_ObjectHideFlags: 0 @@ -2053,7 +2053,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 11415212, guid: fe9bfb5044c0cc646baba1ad7d354100, type: 3} propertyPath: bookPages.Array.size - value: 15 + value: 16 objectReference: {fileID: 0} - target: {fileID: 11415212, guid: fe9bfb5044c0cc646baba1ad7d354100, type: 3} propertyPath: bookPages.Array.data[0] @@ -2115,6 +2115,10 @@ PrefabInstance: propertyPath: bookPages.Array.data[14] value: objectReference: {fileID: 21300000, guid: d91fa24592a8e7748bc197c3cf724359, type: 3} + - target: {fileID: 11415212, guid: fe9bfb5044c0cc646baba1ad7d354100, type: 3} + propertyPath: bookPages.Array.data[15] + value: + objectReference: {fileID: 21300000, guid: c695396d62a18b14e9b7a661a3fe338f, type: 3} - target: {fileID: 11430880, guid: fe9bfb5044c0cc646baba1ad7d354100, type: 3} propertyPath: m_Sprite value: diff --git a/Assets/Scripts/FixSystem/Book/BookManager.cs b/Assets/Scripts/FixSystem/Book/BookManager.cs index 3101fff88..0b8676228 100644 --- a/Assets/Scripts/FixSystem/Book/BookManager.cs +++ b/Assets/Scripts/FixSystem/Book/BookManager.cs @@ -73,6 +73,10 @@ public class BookManager : MonoBehaviour [YarnCommand("OpenBook")] public IEnumerator OpenBook() { + if(book.gameObject.activeInHierarchy) + { + yield break; + } OnBookOpen?.Invoke(); // 如果书还没有激活,先激活它 if (!book.gameObject.activeInHierarchy) @@ -99,8 +103,10 @@ public class BookManager : MonoBehaviour { // Parse the target page from the parameters int targetPage = parameters; + book.interactable=false; // Start the FlipToPageCoroutine and wait for it to finish yield return StartCoroutine(flipmanager.FlipToPageCoroutine(targetPage)); + book.interactable=true; } // Close the book