using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
using System.Collections;

public class Tank : NetworkBehaviour {

	public int shieldDammage = 0;

	public void GetHit()
	{
		if (!isServer)
			return;

		shieldDammage += 10;
		if (shieldDammage >= 100)
		{
			shieldDammage = 0;
			RpcRespawn();
		}
	}

	[ClientRpc]
	void RpcRespawn()
	{
		if (isLocalPlayer)
		{
			// move back to zero location
			Debug.Log("Dead respawning");
			transform.position = Vector3.zero;
		}
	}
}