public override void UpdateItem(object value) { base.UpdateItem(value); m_Item = (PlayerIdentity)value; onPlayerIdentityUpdate.Invoke(m_Item); onPlayerNameUpdate.Invoke(m_Item.Player != null ? NetPlayer.FetchPlayerName(m_Item.Player) : m_UnknownPlayerName); onPlayerNumberUpdate.Invoke(m_Item.Number > 0 ? m_Item.Number.ToString() : string.Empty); onIdentityImageUpdate.Invoke(m_Item.CharacterId != -1 ? m_CharacterDatabase.CharacterModels.First(c => c.Id == m_Item.CharacterId).Image : null); onIsMe.Invoke(PhotonNetwork.player.Equals(m_Item.Player)); onIsDead.Invoke(m_Item.IsDead); onIsCaptain.Invoke(m_Item.IsCaptain); onIdentityHide.Invoke(!m_Item.IsRevealed); }
private void GrantEditorialAccess(PhotonPlayer editor) { if (PhotonNetwork.player.Equals(editor)) { m_BulletinEditor.text = m_BulletinDisplay.text; m_BulletinEditor.gameObject.SetActive(true); m_OtherEditorInfoDisplay.gameObject.SetActive(false); onMeEdit.Invoke(); } else { m_EditToggle.interactable = false; m_EditToggle.isOn = false; m_OtherEditorInfoDisplay.text = string.Format(m_OtherEditorInfoFormat, NetPlayer.FetchPlayerName(editor)); m_OtherEditorInfoDisplay.gameObject.SetActive(true); onOtherEditorEdit.Invoke(editor); } }
public void SendChatMessage(string chatMsg) { PhotonView photonView = PhotonView.Get(this); photonView.RPC("ReceiveChatMessage", PhotonTargets.All, "[" + NetPlayer.FetchPlayerName(PhotonNetwork.player) + "]:" + chatMsg); }