Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- public class Killfeed : MonoBehaviour {
- public List<KillFeedInfo> KFI = new List<KillFeedInfo>();
- public static Killfeed inst;
- // Use this for initialization
- void Start () {
- inst = this;
- }
- // Update is called once per frame
- void Update () {
- }
- void OnGUI()
- {
- GUILayout.BeginArea (new Rect (Screen.width - 100, 0, 100, 200));
- foreach (KillFeedInfo k in KFI)
- {
- GUILayout.BeginHorizontal();
- GUILayout.Label(k.Killer);
- GUILayout.Label(k.Gun);
- GUILayout.Label(k.Killer);
- GUILayout.EndHorizontal();
- }
- GUILayout.EndArea();
- }
- public void Server_SendKillFeed(string Killer,string Gun,string Killed)
- {
- networkView.RPC ("Client_SendKillFeed", RPCMode.All, Killer, Gun, Killed);
- }
- [RPC]
- public void Client_SendKillFeed(string Killer,string Gun,string Killed)
- {
- ConvertParamsToClass (Killer, Gun, Killed);
- }
- private void ConvertParamsToClass(string Killer,string Gun,string Killed)
- {
- KillFeedInfo k = new KillFeedInfo (Killer,Gun,Killed);
- KFI.Add (k);
- }
- }
- [System.Serializable]
- public class KillFeedInfo
- {
- public KillFeedInfo(string K,string G,string V)
- {
- Killer = K;
- Gun = G;
- Killed = V;
- }
- public string Killer;
- public string Gun;
- public string Killed;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement