Exemple #1
0
 /// <summary>
 /// Post all actions in this event at this position with this game object as the controller
 /// </summary>
 /// <param name="controllingObject">The controlling object of the played audio files</param>
 /// <param name="postEvent">The event to post the actions of</param>
 /// <param name="position">The position in world space of the sound</param>
 public static void PostEventAtPosition(GameObject controllingObject, InAudioEventNode postEvent, Vector3 position)
 {
     if (instance != null && controllingObject != null && postEvent != null)
     {
         instance.OnPostEventAtPosition(controllingObject, postEvent, position);
     }
     else
     {
         if (instance == null)
         {
             InDebug.InAudioInstanceMissing(controllingObject);
         }
         else if (controllingObject == null)
         {
             InDebug.MissingControllingObject();
         }
         else if (postEvent == null)
         {
             InDebug.MissingEvent(controllingObject);
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Post all actions in this event attached to this another game object than the one controlling it
 /// </summary>
 /// <param name="controllingObject">The controlling object of the played sources</param>
 /// <param name="postEvent">The event to post the actions of</param>
 /// <param name="attachedToOther">The audio source to attach any audio sources to</param>
 public static void PostEventAttachedTo(GameObject controllingObject, InAudioEventNode postEvent, GameObject attachedToOther)
 {
     if (instance != null && controllingObject != null && postEvent != null)
     {
         instance.OnPostEvent(controllingObject, postEvent, attachedToOther);
     }
     else
     {
         if (instance == null)
         {
             InDebug.InAudioInstanceMissing(controllingObject);
         }
         else if (controllingObject == null)
         {
             InDebug.MissingControllingObject();
         }
         else if (postEvent == null)
         {
             InDebug.MissingEvent(controllingObject);
         }
     }
 }
Exemple #3
0
 /// <summary>
 /// Post all actions in this event in accordance to the data specified in the inspector, but overrides which object is it attached to.
 /// </summary>
 /// <param name="controllingObject">The controlling game object and the future parent of the audio files</param>
 /// <param name="eventList">All the events to post as added in the inspector</param>
 /// <param name="attachedToOther">The object to attach the events to</param>
 public static void PostEventAttachedTo(GameObject controllingObject, InAudioEvent eventList, GameObject attachedToOther)
 {
     if (instance != null && controllingObject != null && eventList != null && eventList.Events != null)
     {
         int     count    = eventList.Events.Count;
         Vector3 position = controllingObject.transform.position;
         for (int i = 0; i < count; i++)
         {
             EventHookListData eventData = eventList.Events[i];
             if (eventData != null && eventData.Event != null)
             {
                 if (eventData.PostAt == EventHookListData.PostEventAt.AttachedTo)
                 {
                     instance.OnPostEvent(controllingObject, eventData.Event, attachedToOther);
                 }
                 else //if post at position
                 {
                     instance.OnPostEvent(controllingObject, eventData.Event, position);
                 }
             }
         }
     }
     else
     {
         if (instance == null)
         {
             InDebug.InAudioInstanceMissing(controllingObject);
         }
         else if (controllingObject == null)
         {
             InDebug.MissingControllingObject();
         }
         else if (eventList == null || eventList.Events == null)
         {
             InDebug.MissingEventList(controllingObject);
         }
     }
 }