private void UpdateTriggerActionNamesOnCollectionRename(string oldCollectionName, string newCollectionName)
        {
            if (string.IsNullOrEmpty(Tools.TrimAll(oldCollectionName)) || string.IsNullOrEmpty(Tools.TrimAll(newCollectionName)))
            {
                return;
            }

            foreach (var triggerCollider in TriggerColliderChooserJSON.choices)
            {
                var oldTriggerActionName         = GetPlayRandomClipTriggerName(triggerCollider, oldCollectionName);
                var newTriggerActionName         = GetPlayRandomClipTriggerName(triggerCollider, newCollectionName);
                var newTriggerActionReceiverName = AudioMateCollectionManager.GetPlayRandomClipActionName(newCollectionName);

                _triggers.UpdateTriggerAction(oldTriggerActionName, newTriggerActionName, newTriggerActionReceiverName, TriggerManager.StartTriggerAction);
                _triggers.UpdateTriggerAction(oldTriggerActionName, newTriggerActionName, newTriggerActionReceiverName, TriggerManager.EndTriggerAction);
            }
        }
        public void OnAddTriggerButtonClicked(string triggerType = TriggerManager.StartTriggerAction)
        {
            if ((UnityEngine.Object)collections == (UnityEngine.Object)null)
            {
                return;
            }
            if (collections.ActiveCollection == null)
            {
                return;
            }
            var triggerName = GetPlayRandomClipTriggerName(TriggerColliderChooserJSON.val, collections.ActiveCollection.Name);

            if (string.IsNullOrEmpty(triggerName))
            {
                return;
            }
            var receiverTargetName = AudioMateCollectionManager.GetPlayRandomClipActionName(collections.ActiveCollection.Name);
            var newTrigger         = _triggers.AddTriggerAction(TriggerColliderChooserJSON.val, triggerName, storeId, receiverTargetName, triggerType);
            //Log($"Added new {triggerType} action {triggerName} for collider trigger {TriggerColliderChooserJSON.val}");
        }
 private static string GetPlayRandomClipTriggerName(string triggerCollider, string collectionName)
 {
     return(Tools.TrimAll($"{triggerCollider}:{AudioMateCollectionManager.GetPlayRandomClipActionName(collectionName)}"));
 }