The question is answered, right answer was accepted
Hi everyone.need help with this.
I have a game object with a script named "spawn" attach to it and there is about four(can be more) other scripts in different game objects which have a reference to this script and calling its method. now I want to create more scenes. these scenes are entirely similar to each other but their spawn method it's different and the other scripts are the same.so how can I change the spawn method and use the other scripts in these new scenes? (because they have a line of code that searches for the Spawn method) I can merge these spawn method but that would be a big script.I'm making a game with about 30 levels and I read that it's better to make new scenes instead of merging the levels in one scene. sorry English isn't my first language so if this is vague just tell me to explain it more!.thanks @Hellium @aldonaletto
Answer by tormentoarmagedoom · May 02, 2018 at 02:30 PM
Good day.
You can do diferent scenes, but use the same spawn script, and inside the script, chech the current level loaded to execute one or other method.
this way all objects thet needs to spawn, call the sam function in spawn script, and wil lbe this function where detects the current level and decide what to do.
Bye!
@tormentoarmagedoom thanks for your answer. but with doing this, what is the point of creating new scenes?.because I'm using this big spawn script in all of the scenes. what if I put all of the levels in just one scene with a big spawn method?.
Its also another solution, yes. But think that as more "small & simple" is the scene, better the performance.
Bye!