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++; } } }
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; } }
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)); } }
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); }
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); }
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()); }
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)); }
public RESULT getListenerAttributes(int listener, out ATTRIBUTES_3D attributes) { return FMOD_Studio_System_GetListenerAttributes(rawPtr, listener, out attributes); }
public RESULT setListenerAttributes(int listener, ATTRIBUTES_3D attributes) { return FMOD_Studio_System_SetListenerAttributes(rawPtr, listener, ref attributes); }
public RESULT set3DAttributes (ATTRIBUTES_3D attributes) { return FMOD_Studio_EventInstance_Set3DAttributes(rawPtr, ref attributes); }
private static extern RESULT FMOD_Studio_EventInstance_Set3DAttributes (IntPtr _event, ref ATTRIBUTES_3D attributes);
private static extern RESULT FMOD_Studio_System_SetListenerAttributes (IntPtr studiosystem, int listener, ref ATTRIBUTES_3D attributes);
public RESULT get3DAttributes(out ATTRIBUTES_3D attributes) { return FMOD_Studio_EventInstance_Get3DAttributes(rawPtr, out attributes); }
public RESULT set3DAttributes(ATTRIBUTES_3D attributes) { return(FMOD_Studio_EventInstance_Set3DAttributes(handle, ref attributes)); }
public RESULT get3DAttributes(out ATTRIBUTES_3D attributes) { return(FMOD_Studio_EventInstance_Get3DAttributes(handle, out attributes)); }
public RESULT get3DAttributes(out ATTRIBUTES_3D attributes) { return(EventInstance.FMOD_Studio_EventInstance_Get3DAttributes(this.rawPtr, out attributes)); }
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)); }
public RESULT set3DAttributes(ATTRIBUTES_3D attributes) { return(EventInstance.FMOD_Studio_EventInstance_Set3DAttributes(this.rawPtr, ref attributes)); }
private static extern RESULT FMOD_Studio_System_SetListenerAttributes(IntPtr studiosystem, int listener, ref ATTRIBUTES_3D attributes);
public RESULT setListenerAttributes(int listener, ATTRIBUTES_3D attributes) { return(System.FMOD_Studio_System_SetListenerAttributes(this.rawPtr, listener, ref attributes)); }
public RESULT getListenerAttributes(int listener, out ATTRIBUTES_3D attributes) { return(System.FMOD_Studio_System_GetListenerAttributes(this.rawPtr, listener, out attributes)); }