Ejemplo n.º 1
0
        private void Refresh()
        {
            if (ListenerList.Count == 1)
            {
                if (s_SpatialAudioListener != null)
                {
                    AkSoundEngine.UnregisterSpatialAudioListener(s_SpatialAudioListener.gameObject);
                }

                s_SpatialAudioListener = ListenerList[0];

                AkSoundEngine.RegisterSpatialAudioListener(s_SpatialAudioListener.gameObject);
            }
            else if (ListenerList.Count == 0 && s_SpatialAudioListener != null)
            {
                AkSoundEngine.UnregisterSpatialAudioListener(s_SpatialAudioListener.gameObject);
                s_SpatialAudioListener = null;
            }
        }
Ejemplo n.º 2
0
        private void Refresh()
        {
            if (ListenerList.Count == 1)
            {
                if (s_SpatialAudioListener != null)
                {
                    AkSoundEngine.UnregisterSpatialAudioListener(s_SpatialAudioListener.gameObject);
                }

                s_SpatialAudioListener = ListenerList[0];

                if (AkSoundEngine.RegisterSpatialAudioListener(s_SpatialAudioListener.gameObject) == AKRESULT.AK_Success)
                {
                    s_SpatialAudioListener.SetGameObjectInRoom();
                }
            }
            else if (ListenerList.Count == 0 && s_SpatialAudioListener != null)
            {
                AkSoundEngine.UnregisterSpatialAudioListener(s_SpatialAudioListener.gameObject);
                s_SpatialAudioListener = null;
            }
        }