Advertisement
Guest User

Untitled

a guest
Jul 11th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement