quakeball/Assets/Scripts/Networking/NetPlayer.cs

39 lines
1015 B
C#
Raw Normal View History

using UnityEngine;
using NeonTea.Quakeball.Game;
2020-08-07 20:24:43 +02:00
using NeonTea.Quakeball.Players;
namespace NeonTea.Quakeball.Networking {
public class NetPlayer {
private Player _Controlled;
private ulong _Id;
2020-08-08 06:00:17 +02:00
public ulong Id {
get { return _Id; }
2020-08-08 06:00:17 +02:00
set {
_Id = value;
if (_Controlled != null) {
_Controlled.NetId = _Id;
2020-08-08 06:00:17 +02:00
}
}
}
public Player Controlled {
get { return _Controlled; }
2020-08-08 06:00:17 +02:00
set {
_Controlled = value;
if (_Controlled != null) {
_Controlled.NetId = _Id;
}
2020-08-08 06:00:17 +02:00
}
}
2020-08-08 19:14:34 +02:00
public string Nick;
public Team Team = Team.FreeForAll;
2020-08-08 00:21:02 +02:00
public bool Unsynced = false;
2020-08-08 02:35:19 +02:00
public float Ping = 0;
public NetPlayer(ulong id, Player obj = null) {
Id = id;
Controlled = obj;
2020-08-08 19:14:34 +02:00
Nick = id.ToString();
}
}
}