void Awake() { if ( control == null ) { DontDestroyOnLoad(gameObject); control = this; // this is due to JIT compilation required for the binary formatter, which // is NOT allowed on iOS. Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes"); // slurp control.Load(); } else if ( control == this ) { Destroy(gameObject); } }
// Start is called before the first frame update void Start() { pauseMenu.SetActive(false); ScoreControl.Load(); }