コード例 #1
0
ファイル: EventController.cs プロジェクト: yukpiz/unity-adx2
    public void Awake()
    {
        bgm = gameObject.AddComponent<CriAtomSource>();
        bgm.cueSheet = cueSheetName;

        Button startButton = transform.FindChild("StartButton").GetComponent<Button>();
        Button stopButton = transform.FindChild("StopButton").GetComponent<Button>();
        startButton.onClick.AsObservable()
            .Subscribe(_ =>
            {
                if (bgm.IsPaused())
                {
                    bgm.Pause(false);
                } else
                {
                    Debug.Log("play!!");
                    bgm.Play(cueName);
                }
            });
        stopButton.onClick.AsObservable()
            .Subscribe(_ =>
            {
                if (!bgm.IsPaused())
                {
                    bgm.Pause(true);
                }
            });
    }
コード例 #2
0
 public void PlayBgm()
 {
     if (bgmSource.IsPaused())
     {
         bgmSource.Pause(false);
     }
     else
     {
         bgmSource.Play(cueSheet.name);
     }
 }
コード例 #3
0
 public void Pause()
 {
     atomSourceBgm.Pause(true);
 }
コード例 #4
0
ファイル: MusicADX2.cs プロジェクト: keel-210/MagicHand
 protected override bool SuspendInternal()
 {
     atomSource_.Pause(true);
     return(true);
 }