/// <summary> /// /// </summary> public static void AddMessage(string message, bool broadcast = true) { if (m_Chat == null) { m_Chat = (vp_MPDemoChat)Component.FindObjectOfType(typeof(vp_MPDemoChat)); } if (m_Chat != null) { if (broadcast && (PhotonNetwork.connectionStateDetailed == ClientState.Joined)) { m_Chat.photonView.RPC("AddChatMessage", PhotonTargets.AllBuffered, message); } else { m_Chat.AddChatMessage(message, new PhotonMessageInfo(PhotonNetwork.player, PhotonNetwork.ServerTimestamp, null)); } } }
/// <summary> /// /// </summary> public static void AddMessage(string message, bool broadcast = true) { if (m_Chat == null) m_Chat = (vp_MPDemoChat)Component.FindObjectOfType(typeof(vp_MPDemoChat)); if (m_Chat != null) { if (broadcast && (PhotonNetwork.connectionStateDetailed == PeerState.Joined)) m_Chat.photonView.RPC("AddChatMessage", PhotonTargets.AllBuffered, message); else m_Chat.AddChatMessage(message, null); } }