Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by DevMan5000 · Jun 29, 2015 at 10:26 AM · prefabnguiarchitecturebook

High Level Architecture for Book App

I'm making a book app with 2 page layout prefabs: CoverPagePrefab and StoryPagePrefab.

A PageManager keeps an array of prefab references (one cover page, 20 story pages).

There is only one cover page so I can specialize the CoverPage component on the CoverPagePrefab to load the correct text / image. However, there are 20 story pages so I need a way of initializing them with the correct images/text.

 PageManager::PagePrefabArray
 Element 0: CoverPagePrefab
 Element 1: StoryPagePrefab
 Element 2: StoryPagePrefab
 Element 3: StoryPagePrefab
 ...
 Element 21:StoryPagePrefab

All text is saved in a localization file with names like "Page1", "Page2", .etc.

Right now I am filling out text programmatically (curPageIdx is 1 so I look up text using key "Page_1"). However, if I were to add a page after the coverpage, say a ThankYouPagePrefab, this would break everything. I want a robust solution that would allow for new pages types to be interspersed into the array without breaking text/images.

Essentially what I am asking is, should I have StoryPagePrefab1, StoryPagePrefab2, .etc which hold initialization data, but all share a reference to StoryPagePrefab for layout of game objects? I'm a newbie to Unity so I am super confused about when and where its appropriate to use prefabs.

Thanks

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Is there any way to hide script fields outside of prefab that uses it? 2 Answers

NGUI Sprite became invisible in prefab mode 0 Answers

Dynamic Scrollable List with NGUI 2 Answers

Character keeps falling through terrain (with colliders) 4 Answers

Best way to group child elements with NGUI? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges