public static void AttachAudioComponents(Contexts context, PlayerEntity playerEntity) { GameAudioMedia.Dispose(); playerEntity.AddPlayerAudio(); GameModuleManagement.ForceAllocate(playerEntity.entityKey.Value.EntityId, (PlayerAudioController audioController) => { audioController.Initialize(playerEntity); }); }
private static void AttachAudio(Contexts context, PlayerEntity playerEntity) { GameAudioMedia.Dispose(); playerEntity.AddPlayerAudio(); PlayerAudioControllerBase controller; if (SharedConfig.IsServer) { controller = new ServerPlayerAudioController(); } else { controller = new ClientPlayerAudioController(); } controller.Initialize(playerEntity, context.session.commonSession.RoomInfo.MapId); GameModuleManagement.ForceCache(playerEntity.entityKey.Value.EntityId, controller); }