修复书的页数是奇数会出现错误
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user