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