Forum rules - please read before posting.

preset local variable of other scenes

Hello,

I'm trying to make a dev tool to a certain progress point of the game. I can set the global variables, the inventory and load the related scene but how can I set the local variables of all other scenes? is there a unsaved save game file I can adjust or any other way?

I would also like to know if it's possible to adjust the component variables and all other scene related data (visibility etc.)

Thanks

Comments

  • You can't access components or variables in non-loaded scenes, but that's down to Unity itself.

    You could feasibly access AC's internal record of a given scene's save data - the LevelStorage component's GetLevelData is private, but it you changed it to public you could access the SingleLevelData class with:

    AC.KickStarter.levelStorage.GetLevelData (mySceneIndex);
    

    However, this class isn't intended to be used through custom script, and the data structure doesn't allow for easy modification to values. It's also the case that this data only exists if the Player has previously visited the scene.

    What you're probably best off doing is having a script or Cutscene that is present in the other scene, which can update things in your intended way - at the moment the Player next visits the scene. Your dev tool should then just need a means of keeping track what scenes need updating upon entering them again.

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.