ServerProperty.cs 913 B

1234567891011121314151617181920212223242526272829303132333435
  1. // --------------------------------------------------------------------------------------------------------------------
  2. // <copyright file="IsConnectedProperty.cs" company="Exit Games GmbH">
  3. // Part of: Pun Cockpit
  4. // </copyright>
  5. // <author>developer@exitgames.com</author>
  6. // --------------------------------------------------------------------------------------------------------------------
  7. using UnityEngine.UI;
  8. using Photon.Realtime;
  9. namespace Photon.Pun.Demo.Cockpit
  10. {
  11. /// <summary>
  12. /// PhotonNetwork.Server UI property
  13. /// </summary>
  14. public class ServerProperty : PropertyListenerBase
  15. {
  16. public Text Text;
  17. ServerConnection _cache;
  18. void Update()
  19. {
  20. if (PhotonNetwork.Server != _cache)
  21. {
  22. _cache = PhotonNetwork.Server;
  23. Text.text = PhotonNetwork.Server.ToString();
  24. this.OnValueChanged();
  25. }
  26. }
  27. }
  28. }