您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

24 行
633 B

using UnityEngine;
namespace LobbyRelaySample.UI
{
/// <summary>
/// Show or hide a UI element based on the current GameState (e.g. in a lobby).
/// </summary>
[RequireComponent(typeof(LocalGameStateObserver))]
public class GameStateVisibilityUI : ObserverPanel<LocalGameState>
{
[SerializeField]
GameState ShowThisWhen;
public override void ObservedUpdated(LocalGameState observed)
{
if (!ShowThisWhen.HasFlag(observed.State))
Hide();
else
{
Show();
}
}
}
}