您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
23 行
603 B
23 行
603 B
using UnityEngine;
|
|
|
|
namespace LobbyRelaySample
|
|
{
|
|
/// <summary>
|
|
/// Keeps the rooms list updated automatically.
|
|
/// </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);
|
|
}
|
|
}
|
|
}
|