I have a static class:
public static class SharedBetweenScenes {
public static string value;
}
In a script within a GameObject of the Scene A, I assign a value as follows: SharedBetweenScenes.value = "hi duby duby";
I load the Scene B. I can get the stored value doing: string value = SharedBetweenScenes.value;
Unfortunately, if a load the Scene A again and try to assign a different value: SharedBetweenScenes.value = "hello dude!";
the debugger says The name ‘SharedBetweenScenes.value’ does not exist in the current context.
Furthermore, if I load the Scene B, SharedBetweenScenes.value will have the old value of "hi duby duby"
instead of the new value "hello dude!"
What is going on here? I also tried the singleton code proposed here with the exactly same problem.