- Home /
One small change for many scenes?
Hi, I am programming a game for android with one hundred levels (one level = one scene). But when I finally made all levels, I decided to add some sound effects to countdown timer. So now I need to add audio source to every scene manually. Is there any way how to make it just once and apply this change for all scenes?
Thank you and sorry for my english if something is wrong ;)
Answer by BurningThumb · Apr 27, 2014 at 07:05 AM
Create a "harness" scene, containing the common objects you forgot, then use Application.LoadLevelAdditive() to load in your 100 different levels where you were previously just loading them.
Answer by KellyThomas · Apr 26, 2014 at 04:26 PM
If you have a script that is common to all of your levels (e.g. a score manager or timer) you could use that to instantiate a prefab.
$$anonymous$$ost of the problems I solved with script but for example now I need to add a component "audio source" to gui texture in scene, set basic properties, attached the audio files to the script and to audio source component. And do this 100 times again and again.
Each of these steps can be achieved programmatically at runtime. This QA should help you get started.
Thanks, maybe you are right and I should do it in this way. I just thought it is better and faster do it in GUI of Unity.
Your answer
Follow this Question
Related Questions
Change screen Orientation when change scene 0 Answers
Change scenes from area? 1 Answer
Click Object to change scene 2 Answers
Splitting Android application and level loading 4 Answers
How to switch scenes with no delay 2 Answers