Advertisement
Guest User

Untitled

a guest
Jul 26th, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4.  
  5. public class KillFeed : MonoBehaviour {
  6.     //public string communication;
  7.     public static KillFeed KF;
  8.     public List<string> killFeed = new List<string>();
  9.     // Use this for initialization
  10.     void Start () {
  11.    
  12.     }
  13.     [RPC]
  14.     void Dead(string guy1, string guy2){
  15.         killFeed.Add(guy1 + " killed "  +guy2);
  16.         if (killFeed.Count >= 3) killFeed.RemoveAt(0);
  17.     }
  18.  
  19.     // Update is called once per frame
  20.     void Update () {
  21.    
  22.     }
  23.  
  24.     void OnGUI()
  25.     {
  26.         GUILayout.BeginArea(new Rect(780, 10, 300, 100));
  27.         foreach(string kf in killFeed)
  28.         {
  29.             GUILayout.Label(kf);
  30.         }
  31.         GUILayout.EndArea ();
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement