private void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; } DontDestroyOnLoad(gameObject); }
private void Start() { SoundMainController SMC = SoundMainController.instance; if (SMC != null) { AS.volume = SMC.SS.volume; AS.mute = SMC.SS.mute; if (onStart) { PlaySound(); } } }
private void Start() { SMC = SoundMainController.instance; if (isMusic) { SMC.muteButtonMusic = muteButton; SMC.soundSliderMusic = slider; slider.value = SMC.SS.volumeMusic; } else { SMC.muteButton = muteButton; SMC.soundSlider = slider; slider.value = SMC.SS.volume; } slider.onValueChanged.AddListener(delegate { ValueChangeCheck(); }); }
// Use this for initialization void Start() { SMC = SoundMainController.instance; if (SMC != null) { if (ismusic) { AS.volume = SMC.SS.volumeMusic; AS.mute = SMC.SS.muteMusic; } else { AS.volume = SMC.SS.volume; AS.mute = SMC.SS.mute; SMC.speakers.Add(AS); } } }