private void OnDisable() { AkRoomPortalManager.RegisterRoomUpdate(this); RoomCount--; AkSoundEngine.RemoveRoom(GetID()); }
private void OnEnable() { var roomParams = new AkRoomParams(); roomParams.Up.X = transform.up.x; roomParams.Up.Y = transform.up.y; roomParams.Up.Z = transform.up.z; roomParams.Front.X = transform.forward.x; roomParams.Front.Y = transform.forward.y; roomParams.Front.Z = transform.forward.z; roomParams.ReverbAuxBus = reverbAuxBus.Id; roomParams.ReverbLevel = reverbLevel; roomParams.WallOcclusion = wallOcclusion; roomParams.RoomGameObj_AuxSendLevelToSelf = roomToneAuxSend; roomParams.RoomGameObj_KeepRegistered = roomToneEvent.IsValid() ? true : false; RoomCount++; AkSoundEngine.SetRoom(GetID(), roomParams, name); /// In case a room is disabled and re-enabled. AkRoomPortalManager.RegisterRoomUpdate(this); }