Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using BeardedManStudios.Network;
- public class LobbyMenuUI : NetworkedMonoBehavior {
- private string textArea = "";
- private string textField = "";
- protected override void Awake()
- {
- AddNetworkVariable(() => textArea, x => textArea = (string)x, new NetSync());
- base.Awake ();
- }
- protected override void Start()
- {
- base.Start ();
- }
- protected override void Update()
- {
- base.Update();
- }
- void OnGUI() {
- GUI.TextArea (new Rect (25.0f, 25.0f, 500.0f, 500.0f), textArea);
- textField = GUI.TextField (new Rect (25.0f, 525.0f, 450.0f, 25.0f), textField);
- if (GUI.Button (new Rect (475.0f, 525.0f, 50.0f, 25.0f), "Send")) {
- AppendText();
- }
- }
- void AppendText() {
- textArea += textField + "\n";
- textField = "";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement