|
Post by sparrow on Sept 22, 2022 18:19:38 GMT
I am starting with Demo2 for EndlessBook, I am able to modify the existing PageView_02, PageView_05, .. 19 and 20, so I want to add a PageView_09 for example, can you detail how to go about activating and deactivating pages if I want to add functionality to other pages? I looked through the existing scripts and do not see why when I duplicate and name PageView_09 for example in a similar way as PageView_05 for example, its just always activated instead of activating when that page 09 is turned to. I have attached the PageView script to the new component PageView_09 and added my own child objects to the PageView_09 component, but they are all active instead of activating and deactivating like the other pages. thanks!
|
|
|
Post by echo17 on Sept 23, 2022 10:42:40 GMT
Check out Demo02.cs in the Scripts folder for that demo. Specifically, the code that toggles the page views on and off are in the methods: TogglePageView GetPageView These will automatically toggle the page views for you as long as you name your page view like PageView_09 or PageView_10, etc. You will also need to add your page view to the array in the inspector of the Demo game object in the scene: Just increase the array size and drag your page view game object to the empty slot. The order doesn't matter since the GetPageView method will search for the appropriate one based on the name.
|
|