You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
// --------------------------------------------------------------------------------------------------------------------
|
|
// <copyright file="BestRegionInPrefsProperty.cs" company="Exit Games GmbH">
|
|
// Part of: Pun Cockpit
|
|
// </copyright>
|
|
// <author>developer@exitgames.com</author>
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
|
|
using UnityEngine.UI;
|
|
|
|
namespace Photon.Pun.Demo.Cockpit
|
|
{
|
|
/// <summary>
|
|
/// PhotonNetwork.BestRegionSummaryInPreferences UI property.
|
|
/// </summary>
|
|
public class BestRegionInPrefsProperty : PropertyListenerBase
|
|
{
|
|
public Text Text;
|
|
|
|
string _cache;
|
|
|
|
void Update()
|
|
{
|
|
if (PhotonNetwork.BestRegionSummaryInPreferences != _cache)
|
|
{
|
|
_cache = PhotonNetwork.BestRegionSummaryInPreferences;
|
|
|
|
this.OnValueChanged();
|
|
|
|
if (string.IsNullOrEmpty(_cache))
|
|
{
|
|
Text.text = "n/a";
|
|
}
|
|
else
|
|
{
|
|
Text.text = _cache;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |