SHARE
TWEET

Untitled

a guest Jul 11th, 2015 218 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2. using System.Collections;
  3. using BeardedManStudios.Network;
  4.  
  5. public class LobbyMenuUI : NetworkedMonoBehavior {
  6.  
  7.         private string textArea = "";
  8.         private string textField = "";
  9.  
  10.         protected override void Awake()
  11.         {
  12.                 AddNetworkVariable(() => textArea, x => textArea = (string)x, new NetSync());
  13.  
  14.                 base.Awake (); 
  15.         }
  16.  
  17.         protected override void Start()
  18.         {
  19.                 base.Start ();
  20.         }
  21.  
  22.         protected override void Update()
  23.         {
  24.                 base.Update();
  25.         }
  26.        
  27.         void OnGUI() {
  28.                 GUI.TextArea (new Rect (25.0f, 25.0f, 500.0f, 500.0f), textArea);
  29.                 textField = GUI.TextField (new Rect (25.0f, 525.0f, 450.0f, 25.0f), textField);
  30.                 if (GUI.Button (new Rect (475.0f, 525.0f, 50.0f, 25.0f), "Send")) {
  31.                         AppendText();
  32.                 }
  33.         }
  34.        
  35.         void AppendText() {
  36.                 textArea += textField + "\n";
  37.                 textField = "";
  38.         }
  39.  
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top