Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.Networking;
- using UnityEngine.UI;
- using System.Collections;
- public class NTC : NetworkBehaviour {
- [SyncVar]
- private string broadcastMessage = "textwillgohere";
- public Text theText;
- // Update is called once per frame
- void FixedUpdate () {
- if (Input.GetKeyDown (KeyCode.G))
- {
- TransmitText ("It worked!");
- }
- theText.text = broadcastMessage;
- }
- [Command]
- void CmdProvideTextToServer(string inputText)
- {
- broadcastMessage = inputText;
- }
- [ClientCallback]
- void TransmitText(string inputText)
- {
- Debug.Log ("sdfsdg");
- CmdProvideTextToServer (inputText);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement