private void Awake() { instance = this; if (InputName.instance != null) { ThemeSound.volume = InputName.instance.bgmVolume; ClickSound.volume = InputName.instance.clickVolume; Destroy(InputName.instance.gameObject); } else { ThemeSound.volume = ClickSound.volume = 0.5f; } }
void Awake() { if (ins == null) { ins = this; } else if (ins_ != this) { //전것존재 -> 또다른것 -> 삭제. 이후는 실행안됨(Start, OnEnable)... //Debug.Log ("또생성? 음... 삭제(지금것)"); Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); }