using UnityEngine;
using System.Collections.Generic;

public class GameForce : MonoBehaviour
{
	public int side;
	public Player player
	{
		get
		{
			if (_player == null)
			{
				Player[] players = FindObjectsOfType<Player>();
				foreach (Player p in players)
				{
					if (p.side == this.side)
						_player = p;
				}
			}
			return _player;
		}
	}

	public Player _player;
	
	public void Init(int side)
	{
		Debug.Log("GameForce init " + side);

		this.side = side;

		Player[] players = FindObjectsOfType<Player>();
		foreach (Player p in players)
		{
			if (p.side == this.side)
				_player = p;
		}
	}

	void Update()
	{

	}
}
