using UnityEngine; namespace LobbyRelaySample { /// /// Keeps the lobby list updated automatically. /// public class LobbyListHeartbeat : MonoBehaviour { // This is called in-editor via events. public void SetActive(bool isActive) { if (isActive) Locator.Get.UpdateSlow.Subscribe(OnUpdate); else Locator.Get.UpdateSlow.Unsubscribe(OnUpdate); } private void OnUpdate(float dt) { Locator.Get.Messenger.OnReceiveMessage(MessageType.QueryLobbies, null); } } }