示例#1
0
 public AudioMateClipCollection(string collectionName, AudioMateController controller)
 {
     _controller = controller;
     Name        = collectionName;
     ResetUnplayedClips();
     Init();
 }
示例#2
0
 public void Init(AudioMateController controller)
 {
     if ((UnityEngine.Object)controller == (UnityEngine.Object)null)
     {
         SuperController.LogError($"AudioMate.{nameof(AudioMateCollectionManager)}.{nameof(Init)}: Controller is null.");
         return;
     }
     _controller = controller;
     if (isInitialized)
     {
         Log("Collection manager is already initialized.");
         return;
     }
     Log("### Init ###");
     if ((UnityEngine.Object)_controller.ui == (UnityEngine.Object)null)
     {
         SuperController.LogError($"AudioMate.{nameof(AudioMateCollectionManager)}.{nameof(Init)}: UI is not initialized.");
         return;
     }
     _ui             = _controller.ui;
     CollectionsJSON = _controller.CollectionsJSON;
     CollectionsJSON.setCallbackFunction = SelectActiveCollection;
     SelectActiveCollection();
     isInitialized = true;
 }
示例#3
0
 private void SetDefaults()
 {
     if (ReceiverAtom == null)
     {
         ReceiverAtom = _controller.containingAtom.uid;
     }
     if (ReceiverNode == null)
     {
         ReceiverNode = AudioMateController.GuessInitialReceivingNode(_controller.containingAtom);
     }
     SyncAudioReceiver();
 }
示例#4
0
 public AudioMateClipCollection(string collectionName, IEnumerable <AudioMateClip> clips, AudioMateController controller)
 {
     try
     {
         _controller = controller;
         Name        = collectionName;
         _clips.AddRange(clips);
         ResetUnplayedClips();
         Init();
     }
     catch (Exception e)
     {
         SuperController.LogError($"AudioMate.{nameof(AudioMateClipCollection)}.{nameof(AudioMateClipCollection)} (IEnumerable): {e}");
     }
 }
示例#5
0
 public AudioMateClipCollection(JSONNode jn, AudioMateController controller)
 {
     if (jn == null || jn.AsObject == null)
     {
         return;
     }
     try
     {
         _controller = controller;
         Parse(jn);
     }
     catch (Exception e)
     {
         SuperController.LogError($"AudioMate.{nameof(AudioMateClipCollection)}.{nameof(AudioMateClipCollection)} (JSON): {e}");
     }
 }
示例#6
0
 public AudioMateClipCollection(AudioMateController controller)
 {
     _controller = controller;
     ResetUnplayedClips();
     Init();
 }
示例#7
0
 public TriggerManager(AudioMateController controller)
 {
     _controller = controller;
     Init();
 }