Forum rules - please read before posting.

The best approach for multi-level game

Dear community,

I want to share with me some of your experience and what is the best approach regarding a multi-level game. How to implement the loading and finishing the scenes.

  • Currently, I have multiple Unity scenes, each with the AC.
  • one scene named Main Menu, represent the standard Unity UI, with background, buttons to load a specific scene with AC (button action via script).
  • until now it's very simple... but

  • I want to change the sprite of each button (representing the specific level) as the level is finished: let's say that after I finish the first scene, it goes to level 2 but in the same time if I go to main menu scene the button for level 1 has another sprite. What is the best approach to do this?

Until now, I collect the possibilities and the workflow in order to implement. I set the local variables (boolean) for each scene and change it to true after I finish the level, correct? From the main menu, I will check it if the variable is true or false for a specific level and set the sprite? Can I save the AC local/global variable in PlayerPref?

Best regards.

--
aia

Comments

  • Local variables can only be accessed within the scene. Whenever you want to share a variable across multiple scenes, you need to use Global variables.

    Global variables can be saved to PlayerPrefs, in the form of Options data. Set it's Link to field to Options Data, and it'll be saved/loaded outside of any save file automatically - so it's value will be restored upon starting up the game.

    For more, see the Manual's "Options data" chapter.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.