Search Unity

Object state retention

Discussion in 'Testing & Automation' started by Seaworth, Aug 15, 2019.

  1. Seaworth


    Aug 15, 2019
    Hi folks,

    So I want to save the interactable status of a button so when I come back to a scene I can set it to the same status.

    No problem. Static variable used as a global - set the variables as necessary and then load the new scene. The next part is where I run into the problem and that is when I go back to the initial scene where do I do the reassignment. Neither start nor wakeup seem to do it. So where on loading scene 1 would I set those variables assuming that scene 1 has been called before and I am now coming back to it for a second or third or ... time.