示例#1
0
        public void PlayPause(bool pause)
        {
            if (pause)
            {
                Stop();
            }
            else
            {
                IsPlaying    = true;
                startSample  = GetSampleTime();
                currentBlock = StartBlock;

                if (backingTrackPlayers != null)
                {
                    foreach (AudioSource player in backingTrackPlayers)
                    {
                        player.Play();
                        player.time = (float)(StartBlock * GetBlockTimeLength());
                    }
                }

                Started.Invoke();

                if (playbackStartedEvent != null)
                {
                    playbackStartedEvent.Invoke();
                }

                AdvanceBlock();
            }
        }
        public void Init(Canvas libraryUIPrefab, ChordEditor chordEditorPrefab, MusicSystem musicSystem)
        {
            InitLibrary(libraryUIPrefab);

            chordEditor = Instantiate(chordEditorPrefab);
            base.Init(chordEditor);

            chordEditor.ChordsUpdated.AddListener(UpdateChords);
            chordEventManager.Init();

            PointerPosChanged.AddListener(_ => PointerPosChangedEvent.Invoke());
            chordEditor.ChordsUpdated.AddListener(ChordPlacedEvent.Invoke);
        }
 public void Toggle()
 {
     if (isOpened)
     {
         LeanTween.moveX(rectTransform,
                         rectTransform.anchoredPosition.x + rectTransform.rect.width, toggleTime);
     }
     else
     {
         LeanTween.moveX(rectTransform,
                         rectTransform.anchoredPosition.x - rectTransform.rect.width, toggleTime);
     }
     chordLibraryOpenedEvent.Invoke();
     isOpened = !isOpened;
 }
示例#4
0
 public void OnPointerClick(PointerEventData eventData)
 {
     messageBoxPressedEvent.Invoke();
     MessageBoxPressed.Invoke();
 }