您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
25 行
768 B
25 行
768 B
using UnityEngine;
|
|
using Utilities;
|
|
|
|
namespace LobbyRooms
|
|
{
|
|
/// <summary>
|
|
/// Keeps the rooms list updated automatically.
|
|
/// TODO: This should only be active while the join menu is visible. Also remove the OnVisibilityChange event when a better solution is introduced.
|
|
/// </summary>
|
|
public class RoomsListHeartbeat : MonoBehaviour
|
|
{
|
|
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.QueryRooms, null);
|
|
}
|
|
}
|
|
}
|