Ejemplo n.º 1
0
    public static void UpdateLoopingEvents(List <FMODCommon.LoopingEventInfo> loopingEvents, Animator animator, Transform transform)
    {
        bool flag = animator.IsInTransition(0);
        AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0);

        FMOD.Studio.ATTRIBUTES_3D attributes = default(FMOD.Studio.ATTRIBUTES_3D);
        if (transform.hasChanged)
        {
            attributes = transform.to3DAttributes();
        }
        int i = 0;

        while (i < loopingEvents.Count)
        {
            FMODCommon.LoopingEventInfo loopingEventInfo = loopingEvents[i];
            if (flag || currentAnimatorStateInfo.fullPathHash != loopingEventInfo.startState)
            {
                UnityUtil.ERRCHECK(loopingEventInfo.instance.stop(STOP_MODE.ALLOWFADEOUT));
                UnityUtil.ERRCHECK(loopingEventInfo.instance.release());
                loopingEvents.RemoveAt(i);
            }
            else
            {
                if (transform.hasChanged)
                {
                    UnityUtil.ERRCHECK(loopingEventInfo.instance.set3DAttributes(attributes));
                }
                i++;
            }
        }
    }
Ejemplo n.º 2
0
 private void Update3DAttributes()
 {
     if (this.evt != null && this.evt.isValid())
     {
         FMOD.Studio.ATTRIBUTES_3D attributes = UnityUtil.to3DAttributes(base.gameObject, this.cachedRigidBody);
         this.ERRCHECK(this.evt.set3DAttributes(attributes));
     }
 }
 public void Update3DAttributes(Vector3 vec)
 {
     if (this.evt != null && this.evt.isValid())
     {
         FMOD.Studio.ATTRIBUTES_3D attributes = vec.to3DAttributes();
         this.ERRCHECK(this.evt.set3DAttributes(attributes));
         this.bManualSetPos = true;
     }
 }
Ejemplo n.º 4
0
 private void Update3DAttributes()
 {
     FMOD.Studio.System system = FMOD_StudioSystem.instance.System;
     if (system != null && system.isValid())
     {
         FMOD.Studio.ATTRIBUTES_3D attributes = UnityUtil.to3DAttributes(base.gameObject, this.cachedRigidBody);
         this.ERRCHECK(system.setListenerAttributes(0, attributes));
     }
 }
Ejemplo n.º 5
0
        public static ATTRIBUTES_3D to3DAttributes(GameObject go, Rigidbody rigidbody = null)
        {
            ATTRIBUTES_3D result = go.transform.to3DAttributes();

            if (rigidbody)
            {
                result.velocity = rigidbody.velocity.toFMODVector();
            }
            return(result);
        }
Ejemplo n.º 6
0
        public static ATTRIBUTES_3D to3DAttributes(GameObject go, Rigidbody rigidbody = null)
        {
            ATTRIBUTES_3D result = default(ATTRIBUTES_3D);

            result.forward  = go.transform.forward.toFMODVector();
            result.up       = go.transform.up.toFMODVector();
            result.position = go.transform.position.toFMODVector();
            if (rigidbody)
            {
                result.velocity = rigidbody.velocity.toFMODVector();
            }
            return(result);
        }
Ejemplo n.º 7
0
    public void PlayOneShot(string path, Vector3 position, float volume)
    {
        EventInstance @event = this.GetEvent(path);

        if (@event == null)
        {
            UnityUtil.LogWarning("PlayOneShot couldn't find event: \"" + path + "\"");
            return;
        }
        FMOD.Studio.ATTRIBUTES_3D attributes = position.to3DAttributes();
        FMOD_StudioSystem.ERRCHECK(@event.set3DAttributes(attributes));
        FMOD_StudioSystem.ERRCHECK(@event.setVolume(volume));
        FMOD_StudioSystem.ERRCHECK(@event.start());
        FMOD_StudioSystem.ERRCHECK(@event.release());
    }
Ejemplo n.º 8
0
    private EventInstance PlayOneShot(string path, Vector3 position, float volume, FMOD_StudioSystem.ProcessEventInstanceDelegate eventSetup = null)
    {
        if (this.ShouldBeCulled(path, position))
        {
            return(null);
        }
        EventInstance @event = this.GetEvent(path);

        FMOD.Studio.ATTRIBUTES_3D attributes = position.to3DAttributes();
        FMOD_StudioSystem.ERRCHECK(@event.set3DAttributes(attributes));
        if (eventSetup == null || eventSetup(@event))
        {
            FMOD_StudioSystem.ERRCHECK(@event.start());
        }
        FMOD_StudioSystem.ERRCHECK(@event.release());
        return(@event);
    }
 public RESULT getListenerAttributes(int listener, out ATTRIBUTES_3D attributes)
 {
     return(FMOD_Studio_System_GetListenerAttributes(handle, listener, out attributes));
 }
Ejemplo n.º 10
0
 public RESULT getListenerAttributes(int listener, out ATTRIBUTES_3D attributes)
 {
     return FMOD_Studio_System_GetListenerAttributes(rawPtr, listener, out attributes);
 }
Ejemplo n.º 11
0
 public RESULT setListenerAttributes(int listener, ATTRIBUTES_3D attributes)
 {
     return FMOD_Studio_System_SetListenerAttributes(rawPtr, listener, ref attributes);
 }
Ejemplo n.º 12
0
 public RESULT set3DAttributes               (ATTRIBUTES_3D attributes)
 {
     return FMOD_Studio_EventInstance_Set3DAttributes(rawPtr, ref attributes);
 }
Ejemplo n.º 13
0
 private static extern RESULT FMOD_Studio_EventInstance_Set3DAttributes      (IntPtr _event, ref ATTRIBUTES_3D attributes);
Ejemplo n.º 14
0
 private static extern RESULT FMOD_Studio_System_SetListenerAttributes   (IntPtr studiosystem, int listener, ref ATTRIBUTES_3D attributes);
Ejemplo n.º 15
0
 public RESULT get3DAttributes(out ATTRIBUTES_3D attributes)
 {
     return FMOD_Studio_EventInstance_Get3DAttributes(rawPtr, out attributes);
 }
Ejemplo n.º 16
0
 public RESULT set3DAttributes(ATTRIBUTES_3D attributes)
 {
     return(FMOD_Studio_EventInstance_Set3DAttributes(handle, ref attributes));
 }
Ejemplo n.º 17
0
 public RESULT get3DAttributes(out ATTRIBUTES_3D attributes)
 {
     return(FMOD_Studio_EventInstance_Get3DAttributes(handle, out attributes));
 }
Ejemplo n.º 18
0
 public RESULT get3DAttributes(out ATTRIBUTES_3D attributes)
 {
     return(EventInstance.FMOD_Studio_EventInstance_Get3DAttributes(this.rawPtr, out attributes));
 }
Ejemplo n.º 19
0
 private static extern RESULT FMOD_Studio_EventInstance_Set3DAttributes(IntPtr _event, ref ATTRIBUTES_3D attributes);
 public RESULT setListenerAttributes(int listener, ATTRIBUTES_3D attributes)
 {
     return(FMOD_Studio_System_SetListenerAttributes(handle, listener, ref attributes));
 }
Ejemplo n.º 21
0
 public RESULT set3DAttributes(ATTRIBUTES_3D attributes)
 {
     return(EventInstance.FMOD_Studio_EventInstance_Set3DAttributes(this.rawPtr, ref attributes));
 }
Ejemplo n.º 22
0
 private static extern RESULT FMOD_Studio_System_SetListenerAttributes(IntPtr studiosystem, int listener, ref ATTRIBUTES_3D attributes);
Ejemplo n.º 23
0
 public RESULT setListenerAttributes(int listener, ATTRIBUTES_3D attributes)
 {
     return(System.FMOD_Studio_System_SetListenerAttributes(this.rawPtr, listener, ref attributes));
 }
Ejemplo n.º 24
0
 public RESULT getListenerAttributes(int listener, out ATTRIBUTES_3D attributes)
 {
     return(System.FMOD_Studio_System_GetListenerAttributes(this.rawPtr, listener, out attributes));
 }