first commit

This commit is contained in:
2022-07-08 09:14:55 +08:00
commit 4d6bd72555
1123 changed files with 456307 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="AppVersionProperty.cs" company="Exit Games GmbH">
// Part of: Pun Cockpit
// </copyright>
// <author>developer@exitgames.com</author>
// --------------------------------------------------------------------------------------------------------------------
using UnityEngine;
using UnityEngine.UI;
namespace Photon.Pun.Demo.Cockpit
{
/// <summary>
/// PhotonNetwork.AppVersion UI property.
/// </summary>
public class AppVersionProperty : MonoBehaviour
{
public Text Text;
string _cache;
void Update()
{
if (PhotonNetwork.AppVersion != _cache)
{
_cache = PhotonNetwork.AppVersion;
Text.text = _cache;
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: cd20e7aa24847434aae5f175732ef601
timeCreated: 1529581501
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,40 @@
// --------------------------------------------------------------------------------------------------------------------
// <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;
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: cc582575c6a1e4ec08d8233345cc9ce5
timeCreated: 1530877238
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CloudRegionProperty.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.CloudRegion UI property.
/// </summary>
public class CloudRegionProperty : PropertyListenerBase
{
public Text Text;
string _cache;
void Update()
{
if (PhotonNetwork.CloudRegion != _cache)
{
_cache = PhotonNetwork.CloudRegion;
this.OnValueChanged();
if (string.IsNullOrEmpty(_cache))
{
Text.text = "n/a";
}
else
{
Text.text = _cache;
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e873bef6b926e45989cc835cb13ef3c2
timeCreated: 1524137791
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CountOfPlayersInRoomProperty.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.CountOfPlayersInRooms UI property.
/// </summary>
public class CountOfPlayersInRoomProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.NetworkingClient.Server == ServerConnection.MasterServer)
{
if (PhotonNetwork.CountOfPlayersInRooms != _cache)
{
_cache = PhotonNetwork.CountOfPlayersInRooms;
Text.text = _cache.ToString();
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: efbb55080baae4567af10254c267900c
timeCreated: 1524139797
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CountOfPlayersOnMasterProperty.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.CountOfPlayersOnMaster UI property.
/// </summary>
public class CountOfPlayersOnMasterProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.NetworkingClient.Server == ServerConnection.MasterServer)
{
if (PhotonNetwork.CountOfPlayersOnMaster != _cache)
{
_cache = PhotonNetwork.CountOfPlayersOnMaster;
Text.text = _cache.ToString();
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c8567842684394fb7a291f803abfb20e
timeCreated: 1524140344
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CountOfPlayersProperty.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.CountOfPlayers UI property.
/// </summary>
public class CountOfPlayersProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.NetworkingClient.Server == ServerConnection.MasterServer)
{
if (PhotonNetwork.CountOfPlayers != _cache)
{
_cache = PhotonNetwork.CountOfPlayers;
Text.text = _cache.ToString();
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c65e89c2d31b54d119911da56af443b6
timeCreated: 1524139376
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,43 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CountOfRoomsProperty.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.CountOfRooms UIs property.
/// </summary>
public class CountOfRoomsProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.NetworkingClient.Server == ServerConnection.MasterServer)
{
if (PhotonNetwork.CountOfRooms != _cache)
{
_cache = PhotonNetwork.CountOfRooms;
Text.text = _cache.ToString();
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8da0abdf8617d4c76bc84fc49e21c53b
timeCreated: 1524140003
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CurrentRoomAutoCleanupProperty.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.CurrentRoom.AutoCleanUp UI property.
/// </summary>
public class CurrentRoomAutoCleanupProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.CurrentRoom != null && PhotonNetwork.CurrentRoom.AutoCleanUp)
{
if ((PhotonNetwork.CurrentRoom.AutoCleanUp && _cache != 1) || (!PhotonNetwork.CurrentRoom.AutoCleanUp && _cache != 0))
{
_cache = PhotonNetwork.CurrentRoom.AutoCleanUp ? 1 : 0;
Text.text = PhotonNetwork.CurrentRoom.AutoCleanUp ? "true" : "false";
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b5de4d7e09db242c4aa0d47c4416630b
timeCreated: 1526298103
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,43 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CurrentRoomEmptyRoomTtlProperty.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.CurrentRoom.EmptyRoomTtl UI property.
/// </summary>
public class CurrentRoomEmptyRoomTtlProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.CurrentRoom != null)
{
if (PhotonNetwork.CurrentRoom.EmptyRoomTtl != _cache)
{
_cache = PhotonNetwork.CurrentRoom.EmptyRoomTtl;
Text.text = _cache.ToString();
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 67529d68dc8144ab1a5b19abf91fce56
timeCreated: 1526041823
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,58 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CurrentRoomExpectedUsersProperty.cs" company="Exit Games GmbH">
// Part of: Pun Cockpit
// </copyright>
// <author>developer@exitgames.com</author>
// --------------------------------------------------------------------------------------------------------------------
using System.Linq;
using UnityEngine.UI;
namespace Photon.Pun.Demo.Cockpit
{
/// <summary>
/// PhotonNetwork.CurrentRoom.ExpectedUsers UI property.
/// </summary>
public class CurrentRoomExpectedUsersProperty : PropertyListenerBase
{
public Text Text;
string[] _cache = null;
void Update()
{
if (PhotonNetwork.CurrentRoom == null || PhotonNetwork.CurrentRoom.ExpectedUsers == null)
{
if (_cache != null)
{
_cache = null;
Text.text = "n/a";
}
return;
}
if (_cache == null || (PhotonNetwork.CurrentRoom.ExpectedUsers != null && !PhotonNetwork.CurrentRoom.ExpectedUsers.SequenceEqual(_cache)))
{
Text.text = string.Join("\n", PhotonNetwork.CurrentRoom.ExpectedUsers);
this.OnValueChanged();
return;
}
if (PhotonNetwork.CurrentRoom.ExpectedUsers == null && _cache != null)
{
Text.text = string.Join("\n", PhotonNetwork.CurrentRoom.ExpectedUsers);
this.OnValueChanged();
return;
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 83b21b2f76c734bfab616bc7a3ff65c5
timeCreated: 1526043583
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CurrentRoomIsOfflineProperty.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.CurrentRoom.IsOffline UI property
/// </summary>
public class CurrentRoomIsOfflineProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.CurrentRoom != null)
{
if ((PhotonNetwork.CurrentRoom.IsOffline && _cache != 1) || (!PhotonNetwork.CurrentRoom.IsOffline && _cache != 0))
{
_cache = PhotonNetwork.CurrentRoom.IsOffline ? 1 : 0;
Text.text = PhotonNetwork.CurrentRoom.IsOffline ? "true" : "false";
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e2e2a33f898da45eb9d44ea357e325db
timeCreated: 1531142804
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,42 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CurrentRoomIsOpenProperty.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.CurrentRoom.IsOpen UI property.
/// </summary>
public class CurrentRoomIsOpenProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.CurrentRoom != null)
{
if ((PhotonNetwork.CurrentRoom.IsOpen && _cache != 1) || (!PhotonNetwork.CurrentRoom.IsOpen && _cache != 0))
{
_cache = PhotonNetwork.CurrentRoom.IsOpen ? 1 : 0;
Text.text = PhotonNetwork.CurrentRoom.IsOpen ? "true" : "false";
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 616aae5178f614b47911b3ada06ac650
timeCreated: 1526039184
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CurrentRoomIsVisibleProperty.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.CurrentRoom.IsVisible UI property
/// </summary>
public class CurrentRoomIsVisibleProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.CurrentRoom != null)
{
if ((PhotonNetwork.CurrentRoom.IsVisible && _cache != 1) || (!PhotonNetwork.CurrentRoom.IsVisible && _cache != 0))
{
_cache = PhotonNetwork.CurrentRoom.IsVisible ? 1 : 0;
Text.text = PhotonNetwork.CurrentRoom.IsVisible ? "true" : "false";
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9caca36858e0a4cdb9511261f0525c72
timeCreated: 1526040810
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,42 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CurrentRoomMasterClientIdProperty.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.CurrentRoom.MasterClientId UI property.
/// </summary>
public class CurrentRoomMasterClientIdProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.CurrentRoom != null)
{
if (PhotonNetwork.CurrentRoom.MasterClientId != _cache)
{
_cache = PhotonNetwork.CurrentRoom.MasterClientId;
Text.text = _cache.ToString();
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ded3411e394ba4dcc82f3b6e25871839
timeCreated: 1531143038
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,42 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CurrentRoomMaxPlayersProperty.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.CurrentRoom.MaxPlayers UI property.
/// </summary>
public class CurrentRoomMaxPlayersProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.CurrentRoom != null)
{
if (PhotonNetwork.CurrentRoom.MaxPlayers != _cache)
{
_cache = PhotonNetwork.CurrentRoom.MaxPlayers;
Text.text = _cache.ToString();
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 917233b0ebdbc43ff89ee3e8d30b5d88
timeCreated: 1526041461
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,43 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CurrentRoomNameProperty.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.CurrentRoom.Name UI property.
/// </summary>
public class CurrentRoomNameProperty : PropertyListenerBase
{
public Text Text;
string _cache = null;
void Update()
{
if (PhotonNetwork.CurrentRoom != null)
{
if ((PhotonNetwork.CurrentRoom.Name != _cache))
{
_cache = PhotonNetwork.CurrentRoom.Name;
Text.text = _cache.ToString();
this.OnValueChanged();
}
}
else
{
if (_cache == null)
{
_cache = null;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5ca44b3b830b44829ba0990f748904ae
timeCreated: 1526040981
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,42 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CurrentRoomPlayerCountProperty.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.CurrentRoom.PlayerCount UI property.
/// </summary>
public class CurrentRoomPlayerCountProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.CurrentRoom != null)
{
if (PhotonNetwork.CurrentRoom.PlayerCount != _cache)
{
_cache = PhotonNetwork.CurrentRoom.PlayerCount;
Text.text = _cache.ToString();
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 333fe1be201784f8382dd2e7a1d5c610
timeCreated: 1526038701
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,43 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CurrentRoomPlayerTtlProperty.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.CurrentRoom.PlayerTtl UI property.
/// </summary>
public class CurrentRoomPlayerTtlProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.CurrentRoom != null)
{
if (PhotonNetwork.CurrentRoom.PlayerTtl != _cache)
{
_cache = PhotonNetwork.CurrentRoom.PlayerTtl;
Text.text = _cache.ToString();
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c0888b956b57041c5892998316eb5a59
timeCreated: 1526041715
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RoomListView.cs" company="Exit Games GmbH">
// Part of: Pun Cockpit
// </copyright>
// <author>developer@exitgames.com</author>
// --------------------------------------------------------------------------------------------------------------------
using UnityEngine.UI;
using System.Linq;
namespace Photon.Pun.Demo.Cockpit
{
/// <summary>
/// PhotonNetwork.CurrentRoom.PropertiesListedInLobby UI property.
/// </summary>
public class CurrentRoomPropertiesListedInLobbyProperty : PropertyListenerBase
{
public Text Text;
string[] _cache = null;
void Update()
{
if (PhotonNetwork.CurrentRoom != null)
{
if (_cache == null || !PhotonNetwork.CurrentRoom.PropertiesListedInLobby.SequenceEqual(_cache))
{
_cache = PhotonNetwork.CurrentRoom.PropertiesListedInLobby.Clone() as string[];
Text.text = string.Join("\n", PhotonNetwork.CurrentRoom.PropertiesListedInLobby);
this.OnValueChanged();
}
}
else
{
if (_cache != null)
{
_cache = null;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 3597ecc77cdd74c1fbd06202905bbd3f
timeCreated: 1526297610
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,30 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RoomListView.cs" company="Exit Games GmbH">
// Part of: Pun Cockpit
// </copyright>
// <author>developer@exitgames.com</author>
// --------------------------------------------------------------------------------------------------------------------
using UnityEngine;
using UnityEngine.UI;
namespace Photon.Pun.Demo.Cockpit
{
/// <summary>
/// PhotonNetwork.GameVersion UI property.
/// </summary>
public class GameVersionProperty : MonoBehaviour
{
public Text Text;
string _cache;
void Update()
{
if (PhotonNetwork.GameVersion != _cache) {
_cache = PhotonNetwork.GameVersion;
Text.text = _cache;
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d5168ef825c3e4b74aff060ca5c07cc1
timeCreated: 1524135958
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,33 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IsConnectedAndReady.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.IsConnectedAndReady UI property
/// </summary>
public class IsConnectedAndReadyProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if ((PhotonNetwork.IsConnectedAndReady && _cache != 1) || (!PhotonNetwork.IsConnectedAndReady && _cache != 0))
{
_cache = PhotonNetwork.IsConnectedAndReady ? 1 : 0;
Text.text = PhotonNetwork.IsConnectedAndReady ? "true" : "false";
this.OnValueChanged();
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 17aa2c6db1ece46789212ad7c5e21509
timeCreated: 1530714133
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,32 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IsConnectedProperty.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.IsConnected UI property
/// </summary>
public class IsConnectedProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if ((PhotonNetwork.IsConnected && _cache != 1) || (!PhotonNetwork.IsConnected && _cache != 0))
{
_cache = PhotonNetwork.IsConnected ? 1 : 0;
Text.text = PhotonNetwork.IsConnected ? "true" : "false";
this.OnValueChanged();
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 398773e8d21e14a6780ad50d653d4b9e
timeCreated: 1530713911
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,32 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="OfflineModeProperty.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.OfflineMode UI property
/// </summary>
public class OfflineModeProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if ((PhotonNetwork.OfflineMode && _cache != 1) || (!PhotonNetwork.OfflineMode && _cache != 0))
{
_cache = PhotonNetwork.OfflineMode ? 1 : 0;
Text.text = PhotonNetwork.OfflineMode ? "true" : "false";
this.OnValueChanged();
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: edcf52eea40f24f198dce8342b53bcc4
timeCreated: 1532432670
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,42 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RoomListView.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.GetPing() UI property.
/// </summary>
public class PingProperty : PropertyListenerBase
{
public Text Text;
int _cache = -1;
void Update()
{
if (PhotonNetwork.IsConnectedAndReady)
{
if (PhotonNetwork.GetPing() != _cache)
{
_cache = PhotonNetwork.GetPing();
Text.text = _cache.ToString() + " ms";
this.OnValueChanged();
}
}
else
{
if (_cache != -1)
{
_cache = -1;
Text.text = "n/a";
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2651ec6773ffe4831b1fce07d51c186a
timeCreated: 1524136274
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,43 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RoomListView.cs" company="Exit Games GmbH">
// Part of: Pun Cockpit
// </copyright>
// <author>developer@exitgames.com</author>
// --------------------------------------------------------------------------------------------------------------------
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
namespace Photon.Pun.Demo.Cockpit
{
/// <summary>
/// Property listener base.
/// </summary>
public class PropertyListenerBase : MonoBehaviour
{
public Graphic UpdateIndicator;
private YieldInstruction fadeInstruction = new YieldInstruction();
float Duration = 1f;
public void OnValueChanged()
{
StartCoroutine(FadeOut(UpdateIndicator));
}
IEnumerator FadeOut(Graphic image)
{
float elapsedTime = 0.0f;
Color c = image.color;
while (elapsedTime < Duration)
{
yield return fadeInstruction;
elapsedTime += Time.deltaTime;
c.a = 1.0f - Mathf.Clamp01(elapsedTime / Duration);
image.color = c;
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4be7d208de29c469d8cc6e686be2329c
timeCreated: 1524137148
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,42 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RoomListView.cs" company="Exit Games GmbH">
// Part of: Pun Cockpit
// </copyright>
// <author>developer@exitgames.com</author>
// --------------------------------------------------------------------------------------------------------------------
using UnityEngine;
using UnityEngine.UI;
namespace Photon.Pun.Demo.Cockpit
{
/// <summary>
/// PhotonNetwork.ServerAddress UI property.
/// </summary>
public class ServerAddressProperty : MonoBehaviour
{
public Text Text;
string _cache;
void Update()
{
if (PhotonNetwork.IsConnectedAndReady)
{
if (PhotonNetwork.ServerAddress != _cache)
{
_cache = PhotonNetwork.ServerAddress;
Text.text = _cache;
}
}
else
{
if (_cache != "n/a")
{
_cache = "n/a";
Text.text = _cache;
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f467ca90418914fcd959dcc9ebb1edca
timeCreated: 1524137548
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,35 @@
// --------------------------------------------------------------------------------------------------------------------
// <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();
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6aeb7bea76d39499e83ebc277ffdd7a7
timeCreated: 1530714932
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: