Почему не работает текстовый чат в Unity Pun2?
[SerializeField] TMP_InputField textMessageField;
[SerializeField] GameObject chatText;
[SerializeField] Transform content;
private PhotonView PhotonView;
void Start()
{
PhotonView = GetComponent<PhotonView>();
}
public void SendButton()
{
PhotonView.RPC("Send_Data", RpcTarget.AllBuffered, PhotonNetwork.NickName, textMessageField.text);
}
[PunRPC]
void Send_Data(string nick, string message)
{
TMP_Text text = Instantiate(chatText, content).GetComponent<TMP_Text>();
text.text = nick + ": " + message;
}
текст не спавниться