コード例 #1
0
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(gameObject);
 }
コード例 #2
0
    private void Start()
    {
        SoundMainController SMC = SoundMainController.instance;

        if (SMC != null)
        {
            AS.volume = SMC.SS.volume;
            AS.mute   = SMC.SS.mute;
            if (onStart)
            {
                PlaySound();
            }
        }
    }
コード例 #3
0
 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(); });
 }
コード例 #4
0
 // 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);
         }
     }
 }