Beispiel #1
0
 public void Bind(AudioMateCollectionManager collectionManager)
 {
     if ((UnityEngine.Object)collectionManager == (UnityEngine.Object)null)
     {
         SuperController.LogError("AudioMate: Error during bind. collectionManager is null.");
         return;
     }
     Log("### Bind ###");
     Collections       = collectionManager;
     _activeCollection = Collections.ActiveCollection;
     clipLibrary.Bind();
     Collections.OnActiveCollectionSelected.AddListener(OnActiveCollectionSelected);
     Collections.OnActiveCollectionUpdated.AddListener(OnActiveCollectionUpdated);
     Collections.OnActiveCollectionSelected.AddListener(clipLibrary.OnActiveCollectionSelected);
     Collections.OnActiveCollectionUpdated.AddListener(clipLibrary.OnActiveCollectionUpdated);
     _popupCollectionList.popup.onOpenPopupHandlers += Collections.SyncCollectionNames;
     _popupCollectionList.popup.enabled              = true;
     _btnGroupAddClips.GetButtonAt(0)?.button.onClick.AddListener(Collections.Add10ClipsToActiveCollection);
     _btnGroupAddClips.GetButtonAt(1)?.button.onClick.AddListener(Collections.Add20ClipsToActiveCollection);
     _btnGroupAddClips.GetButtonAt(2)?.button.onClick.AddListener(Collections.AddAllClipsToActiveCollection);
     _btnClear.button.onClick.AddListener(Collections.ClearActiveCollection);
     _btnPlayRandomClip.button.onClick.AddListener(() =>
     {
         Collections.PlayRandomClipAction();
     });
     _btnQueueRandomClip.button.onClick.AddListener(() => Collections.QueueRandomClipAction());
     Collections.SyncCollectionNames();
     clipLibrary.RefreshUI();
     Collections.SelectActiveCollection();
 }
Beispiel #2
0
 public void Bind()
 {
     Log("### Bind ###");
     _collections      = _controller.collections;
     _activeCollection = _collections.ActiveCollection;
     _isBound          = true;
     IndexSourceClips();
 }