public override void OnInspectorGUI() { _target = (PlayerRoomIndexing)target; _target.OnRoomIndexingChanged += RefreshData; if (PhotonNetwork.inRoom) { EditorGUILayout.LabelField("Player Index", "PhotonPlayer ID"); if (_target.PlayerIds != null) { int index = 0; foreach (int ID in _target.PlayerIds) { GUI.enabled = ID != 0; EditorGUILayout.LabelField("Player " + index + (PhotonNetwork.player.ID == ID?" - You -":"") + (PhotonNetwork.masterClient.ID == ID?" Master":"") , ID == 0?"n/a":PhotonPlayer.Find(ID).ToStringFull()); GUI.enabled = true; index++; } } } else { GUILayout.Label("Room Indexing only works when localPlayer is inside a room"); } }
public void Awake() { if (instance != null) { Debug.LogError("Existing instance of PlayerRoomIndexing found. Only One instance is required at the most. Please correct and have only one at any time."); } instance = this; }
public void Awake() { if (Object.op_Inequality((Object)PlayerRoomIndexing.instance, (Object)null)) { Debug.LogError((object)"Existing instance of PlayerRoomIndexing found. Only One instance is required at the most. Please correct and have only one at any time."); } PlayerRoomIndexing.instance = this; }
public void Awake() { if (PlayerRoomIndexing.instance != null) { Debug.LogError("Existing instance of PlayerRoomIndexing found. Only One instance is required at the most. Please correct and have only one at any time."); } PlayerRoomIndexing.instance = this; if (PhotonNetwork.room != null) { this.SanitizeIndexing(true); } }
public void Awake() { if (instance != null) { Debug.LogError("Existing instance of PlayerRoomIndexing found. Only One instance is required at the most. Please correct and have only one at any time."); } instance = this; // check if we are already in room, likely if component was added at runtime or came late into scene if (PhotonNetworkManager.room != null) { SanitizeIndexing(true); } }
void OnDisable() { _target = (PlayerRoomIndexing)target; _target.OnRoomIndexingChanged -= RefreshData; }
void OnDisable() { _target = (PlayerRoomIndexing)target; _target.OnRoomIndexingChanged.RemoveListener(RefreshData); }
void OnEnable() { _target = (PlayerRoomIndexing)target; _target.OnRoomIndexingChanged.AddListener(RefreshData); }