Pun-01/Assets/Photon/PhotonUnityNetworking/Demos/PunCockpit/Scripts/ReadOnlyProperties/ServerProperty.cs

35 lines
947 B
C#
Raw Permalink Normal View History

2022-07-08 09:14:55 +08:00
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IsConnectedProperty.cs" company="Exit Games GmbH">
// Part of: Pun Cockpit
// </copyright>
// <author>developer@exitgames.com</author>
// --------------------------------------------------------------------------------------------------------------------
using UnityEngine.UI;
using Photon.Realtime;
namespace Photon.Pun.Demo.Cockpit
{
/// <summary>
/// PhotonNetwork.Server UI property
/// </summary>
public class ServerProperty : PropertyListenerBase
{
public Text Text;
ServerConnection _cache;
void Update()
{
if (PhotonNetwork.Server != _cache)
{
_cache = PhotonNetwork.Server;
Text.text = PhotonNetwork.Server.ToString();
this.OnValueChanged();
}
}
}
}