private void OnEnableEditorListener() { if (!Application.isPlaying && AkSoundEngine.IsInitialized()) { AkSoundEngine.RegisterGameObj(gameObject, gameObject.name); var id = AkSoundEngine.GetAkGameObjectID(gameObject); AkSoundEnginePINVOKE.CSharp_AddDefaultListener(id); UnityEditor.EditorApplication.update += UpdateEditorListenerPosition; } }
private void OnEnableEditorListener(UnityEngine.GameObject gameObject) { if (!UnityEngine.Application.isPlaying && AkSoundEngine.IsInitialized() && editorListenerGameObject == null) { editorListenerGameObject = gameObject; AkSoundEngine.RegisterGameObj(editorListenerGameObject, editorListenerGameObject.name); // Do not create AkGameObj component when adding this listener var id = AkSoundEngine.GetAkGameObjectID(editorListenerGameObject); AkSoundEnginePINVOKE.CSharp_AddDefaultListener(id); UnityEditor.EditorApplication.update += UpdateEditorListenerPosition; } }
private void OnEnableEditorListener(UnityEngine.GameObject gameObject) { if (!UnityEngine.Application.isPlaying && AkSoundEngine.IsInitialized() && editorListenerGameObject == null) { editorListenerGameObject = gameObject; // Clearing the isDirty flag of the AkAudioListener list. AkAudioListener.DefaultListeners.Refresh(); AkSoundEngine.RegisterGameObj(editorListenerGameObject, editorListenerGameObject.name); var id = AkSoundEngine.GetAkGameObjectID(editorListenerGameObject); AkSoundEnginePINVOKE.CSharp_AddDefaultListener(id); UnityEditor.EditorApplication.update += UpdateEditorListenerPosition; } }