|
Post by ryanmccauley211 on Aug 8, 2023 16:29:59 GMT
This could be related to how I am setting things up as I am doing a lot dynamically in scripts, but after running my scene if the EndlessBook game object is not selected in the hierarchy it doesn't seem to be fully initialized. For example if I have another object selected and begin turning pages with input keys I have set up the pages will not have the textures and all I will get out of ArgumentOutOfRangeException as the pages do not seem to have been added to the book.
This is how I have it set up. I have a gameobject with the EndlessBook component and no pages initialized. I initialize pages just as empty ones at the beginning at OnStart()
protected void InitializePages(int nbPages)
{
for (int i = 0; i < nbPages; i++)
{
PageData pageData = endlessBook.AddPageData();
pageData.material = null;
}
} The book is closed_front at this point, then when I open the book or turn pages it will render the 2 pages using materials derived from render cameras. This all works fine if I click on the book gameobject in the hierarchy before opening the book but fails if another gameobject is selected
|
|
|
Post by echo17 on Aug 9, 2023 11:50:03 GMT
I'd need to see a working example to give you a diagnosis. Please see this FAQ: link. Please be sure to include instructions to recreate the issue.
|
|