예제 #1
0
    public void SetRoom()
    {
        ulong geometryID = GetGeometryID();

#if UNITY_EDITOR
        if (previousUp == transform.up &&
            previousFront == transform.forward &&
            previousReverbAuxBus == reverbAuxBus.Id &&
            previousReverbLevel == reverbLevel &&
            previousTransmissionLoss == transmissionLoss &&
            previousRoomGameObj_AuxSendLevelToSelf == roomToneAuxSend &&
            previousRoomGameObj_KeepRegistered == roomToneEvent.IsValid() &&
            previousGeometryID == geometryID)
        {
            return;
        }
#endif
        var roomParams = new AkRoomParams
        {
            Up    = transform.up,
            Front = transform.forward,

            ReverbAuxBus     = reverbAuxBus.Id,
            ReverbLevel      = reverbLevel,
            TransmissionLoss = transmissionLoss,

            RoomGameObj_AuxSendLevelToSelf = roomToneAuxSend,
            RoomGameObj_KeepRegistered     = roomToneEvent.IsValid(),
        };

        RoomCount++;
        AkSoundEngine.SetRoom(GetID(), roomParams, geometryID, name);

#if UNITY_EDITOR
        previousUp               = transform.up;
        previousFront            = transform.forward;
        previousReverbAuxBus     = reverbAuxBus.Id;
        previousReverbLevel      = reverbLevel;
        previousTransmissionLoss = transmissionLoss;
        previousRoomGameObj_AuxSendLevelToSelf = roomToneAuxSend;
        previousRoomGameObj_KeepRegistered     = roomToneEvent.IsValid();
        previousGeometryID = geometryID;
#endif

        /// In case a room is disabled and re-enabled.
        AkRoomManager.RegisterRoomUpdate(this);
    }
예제 #2
0
    void UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize()
    {
#if UNITY_EDITOR
        if (!data.IsValid() && AK.Wwise.BaseType.IsByteArrayValidGuid(valueGuid))
        {
            data.valueGuid = valueGuid;
            WwiseObjectReference.migrate += data.MigrateData;
        }

        valueGuid = null;
#endif
    }
예제 #3
0
 /// <summary>
 /// Calls the Wwise event
 /// </summary>
 /// <param name="caller">The game object calling the event</param>
 public void PostWwiseEvent(GameObject caller)
 {
     // post wwise event
     if (wwiseEvent.IsValid())
     {
         Debug.Log(wwiseEvent);
         wwiseEvent.Post(caller);
     }
     // audio not yet created
     else
     {
         Debug.LogWarning("Warning: missing audio for audio event: " + name);
     }
 }