private void InstantiateController() { if (Instance == null) { Instance = this; DontDestroyOnLoad(this); } else if (this != Instance) { Destroy(this.gameObject); } }
void Start() { if (instance == null) { instance = this; } else { Destroy(this); } if (!PlayerPrefsX.GetBool(GameKeys.kPrefSoundOn)) { gameObject.GetComponent <Image> ().sprite = soundON; } else { gameObject.GetComponent <Image> ().sprite = soundOFF; } }