Esempio n. 1
0
 /// <summary>
 /// Plays the audio specified by the trigger id. Returns true if the trigger id is valid
 /// </summary>
 /// <param name="triggerId"></param>
 /// <returns></returns>
 public static bool Play(AudioTriggerId triggerId)
 {
     if (triggerId.IsValid)
     {
         NativeAudioSystem.ExecuteTrigger(triggerId._id);
         return(true);
     }
     return(false);
 }
Esempio n. 2
0
        /// <summary>
        /// Retrieves and executes the specified audio trigger by name
        /// </summary>
        /// <param name="triggerName"></param>
        /// <returns>Returns true if the audio trigger is executed. False otherwise</returns>
        public static bool Play(string triggerName)
        {
            uint triggerId = InvalidControlId;

            AudioManager.AddOrGetTrigger(triggerName, out triggerId);
            if (triggerId == InvalidControlId)
            {
                return(false);
            }
            NativeAudioSystem.ExecuteTrigger(triggerId);
            return(true);
        }