void Awake() { #if UNITY_EDITOR if (AkUtilities.IsMigrating) { return; } #endif // If the object was marked as static, don't update its position to save cycles. #if UNITY_EDITOR if (!UnityEditor.EditorApplication.isPlaying) { UnityEditor.EditorApplication.update += this.CheckStaticStatus; return; } #endif if (!isStaticObject) { m_posData = new AkGameObjPositionData(); } // Cache the bounds to avoid calls to GetComponent() m_Collider = GetComponent <Collider>(); //Register a Game Object in the sound engine, with its name. AKRESULT res = AkSoundEngine.RegisterGameObj(gameObject, gameObject.name, (uint)(listenerMask & ALL_LISTENER_MASK)); if (res == AKRESULT.AK_Success) { // Get position with offset Vector3 position = GetPosition(); //Set the original position AkSoundEngine.SetObjectPosition( gameObject, position.x, position.y, position.z, transform.forward.x, transform.forward.y, transform.forward.z, transform.up.x, transform.up.y, transform.up.z); if (isEnvironmentAware) { m_envData = new AkGameObjEnvironmentData(); //Check if this object is also an environment. m_envData.AddAkEnvironment(gameObject, gameObject); } } }
private void OnTriggerEnter(UnityEngine.Collider other) { #if UNITY_EDITOR if (AkUtilities.IsMigrating || !UnityEditor.EditorApplication.isPlaying) { return; } #endif if (isEnvironmentAware && m_envData != null) { m_envData.AddAkEnvironment(other, m_Collider); } }
void Awake() { #if UNITY_EDITOR if (AkUtilities.IsMigrating) { return; } // If the object was marked as static, don't update its position to save cycles. if (!UnityEditor.EditorApplication.isPlaying) { UnityEditor.EditorApplication.update += this.CheckStaticStatus; return; } #endif if (!isStaticObject) { m_posData = new AkGameObjPositionData(); } // Cache the bounds to avoid calls to GetComponent() m_Collider = GetComponent <Collider>(); //Register a Game Object in the sound engine, with its name. AKRESULT res = AkSoundEngine.RegisterGameObj(gameObject, gameObject.name); if (res == AKRESULT.AK_Success) { // Get position with offset or custom position and orientation. Vector3 position = GetPosition(); Vector3 forward = GetForward(); Vector3 up = GetUpward(); //Set the original position AkSoundEngine.SetObjectPosition( gameObject, position.x, position.y, position.z, forward.x, forward.y, forward.z, up.x, up.y, up.z); if (isEnvironmentAware && m_Collider) { m_envData = new AkGameObjEnvironmentData(); //Check if this object is also an environment. m_envData.AddAkEnvironment(m_Collider, m_Collider); } m_listeners.Initialize(); } }
void OnTriggerEnter(Collider other) { #if !DISABLE_AKSOUNDENGINE #if UNITY_EDITOR if (AkMigrating.IsMigrating || !UnityEditor.EditorApplication.isPlaying) { return; } #endif if (isEnvironmentAware && m_envData != null) { m_envData.AddAkEnvironment(other, m_Collider); } #endif }
void Awake() { #if UNITY_EDITOR if (AkUtilities.IsMigrating) { return; } if (!UnityEditor.EditorApplication.isPlaying) { UnityEditor.EditorApplication.update += this.CheckStaticStatus; } #endif // If the object was marked as static, don't update its position to save cycles. if (!isStaticObject) { m_posData = new AkGameObjPositionData(); } // Cache the bounds to avoid calls to GetComponent() m_Collider = GetComponent <Collider>(); //Register a Game Object in the sound engine, with its name. AKRESULT res = AkSoundEngine.RegisterGameObj(gameObject, gameObject.name); if (res == AKRESULT.AK_Success) { // Get position with offset or custom position and orientation. //Set the original position AkSoundEngine.SetObjectPosition(gameObject, GetPosition(), GetForward(), GetUpward()); if (isEnvironmentAware && m_Collider) { m_envData = new AkGameObjEnvironmentData(); //Check if this object is also an environment. m_envData.AddAkEnvironment(m_Collider, m_Collider); m_envData.UpdateAuxSend(gameObject, transform.position); } int Count = m_listeners.initialListenerList.Count; for (int ii = 0; ii < Count; ++ii) { AddListener(m_listeners.initialListenerList[ii]); } } }
private void Awake() { #if UNITY_EDITOR if (!AkSoundEngineController.Instance.IsSoundEngineLoaded || AkUtilities.IsMigrating) { return; } if (!UnityEditor.EditorApplication.isPlaying) { UnityEditor.EditorApplication.update += CheckStaticStatus; } #endif // If the object was marked as static, don't update its position to save cycles. if (!isStaticObject) { m_posData = new AkGameObjPositionData(); } // Cache the bounds to avoid calls to GetComponent() m_Collider = GetComponent <UnityEngine.Collider>(); //Register a Game Object in the sound engine, with its name. if (Register() == AKRESULT.AK_Success) { // Get position with offset or custom position and orientation. //Set the original position AkSoundEngine.SetObjectPosition(gameObject, GetPosition(), GetForward(), GetUpward()); if (isEnvironmentAware) { m_envData = new AkGameObjEnvironmentData(); if (m_Collider) { m_envData.AddAkEnvironment(m_Collider, m_Collider); } m_envData.UpdateAuxSend(gameObject, transform.position); } m_listeners.Init(this); } }
void OnTriggerEnter(Collider other) { #if UNITY_EDITOR if (AkUtilities.IsMigrating) { return; } if (!UnityEditor.EditorApplication.isPlaying) { return; } #endif if (isEnvironmentAware && m_envData != null) { m_envData.AddAkEnvironment(other.gameObject, gameObject); } }