Ejemplo n.º 1
0
        public static uint AuxSend(Vector3 pos, AkAuxSendArray array)
        {
            array.Reset();
            Zone z = Zone.Get(pos);

            if (z == null)
            {
                return(0);
            }
            else
            {
                uint count;
                switch (z.Reverb.Value)
                {
                case ReverbMode.Room:
                    array.Add(AK.AUX_BUSSES.REVERB, 1.0f);
                    count = 1;
                    break;

                case ReverbMode.Subtle:
                    array.Add(AK.AUX_BUSSES.REVERB_SUBTLE, 1.0f);
                    count = 1;
                    break;

                default:
                    count = 0;
                    break;
                }
                return(count);
            }
        }
    private void AddHighestPriorityEnvironmentsFromPortals(UnityEngine.Vector3 position)
    {
        for (var i = 0; i < activePortals.Count; i++)
        {
            var portal = activePortals[i];
            if (portal.EnvironmentsShareAuxBus)
            {
                var env = portal.environments[0];
                if (env == null)
                {
                    continue;
                }

                var index = activeEnvironmentsFromPortals.BinarySearch(env, AkEnvironment.s_compareByPriority);
                if (index < 0 || index >= AkEnvironment.MAX_NB_ENVIRONMENTS)
                {
                    continue;
                }

                var auxBusID = env.data.Id;
                if (!auxSendValues.Contains(auxBusID))
                {
                    auxSendValues.Add(auxBusID, 1.0f);
                    if (auxSendValues.isFull)
                    {
                        return;
                    }
                }
                continue;
            }

            for (var j = 0; j < AkEnvironmentPortal.MAX_ENVIRONMENTS_PER_PORTAL; j++)
            {
                var env = portal.environments[j];
                if (env == null)
                {
                    continue;
                }

                var index = activeEnvironmentsFromPortals.BinarySearch(env, AkEnvironment.s_compareByPriority);
                if (index < 0 || index >= AkEnvironment.MAX_NB_ENVIRONMENTS)
                {
                    continue;
                }

                var auxBusID = env.data.Id;
                if (!auxSendValues.Contains(auxBusID))
                {
                    auxSendValues.Add(auxBusID, portal.GetAuxSendValueForPosition(position, j));
                    if (auxSendValues.isFull)
                    {
                        return;
                    }
                }
            }
        }
    }
 private void AddHighestPriorityEnvironmentsFromPortals(UnityEngine.Vector3 position)
 {
     for (var i = 0; i < activePortals.Count; i++)
     {
         for (var j = 0; j < AkEnvironmentPortal.MAX_ENVIRONMENTS_PER_PORTAL; j++)
         {
             var env = activePortals[i].environments[j];
             if (env != null)
             {
                 var index = activeEnvironmentsFromPortals.BinarySearch(env, AkEnvironment.s_compareByPriority);
                 if (index >= 0 && index < AkEnvironment.MAX_NB_ENVIRONMENTS)
                 {
                     auxSendValues.Add(env.GetAuxBusID(), activePortals[i].GetAuxSendValueForPosition(position, j));
                     if (auxSendValues.isFull)
                     {
                         return;
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 4
0
        public void SetEnvironmentBasedOnFloor(int floor)
        {
            AkAuxSendArray aEnvs         = new AkAuxSendArray();
            int            floorAuxIndex = floorAuxMap[floor];

            for (int i = 0; i < auxCount; i++)
            {
                float value = (floorAuxIndex == i) ? 1.0f : 0.0f;
                auxValues[i] = value;
                aEnvs.Add(AkSoundEngine.GetIDFromString(floorAux[i]), value);
            }

            AkSoundEngine.SetGameObjectAuxSendValues(gameObject, aEnvs, (uint)auxCount);
        }
Ejemplo n.º 5
0
    void UpdateAuxSend()
    {
        if (m_auxSendValues == null)
        {
            m_auxSendValues = new AkAuxSendArray((uint)m_activeAuxSends.Count);
        }
        else
        {
            m_auxSendValues.Reset();
        }

        foreach (AkAuxSend AuxSend in m_activeAuxSends)
        {
            m_auxSendValues.Add(AuxSend.GetAuxBusID(), AuxSend.GetAuxSendValueForPosition(this.transform.Position));
        }

        AkSoundEngine.SetGameObjectAuxSendValues(this.Entity, m_auxSendValues, (uint)m_activeAuxSends.Count);
    }