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

public class ChooseCharacter : MonoBehaviour 
{

	public bool ghost = false;
	public bool lady = true;

	public Image imgLady;
	public Image imgGhost;

	private Button button;

	public Text ipAddress;
	public Text yourIpAddressLBL;

	public Button playServerButton;
	public Button playClientButton;

	public Image playServerButtonImage;
	public Image playClientButtonImage;

	public Text insertIpAddressLBL;
	public InputField inputField;
	public Image inputFieldImage;

	void Awake()
	{
		button = GetComponent<Button> () as Button;
		button.onClick.AddListener (() => OnClickListener());
	}

	private void OnClickListener()
	{
		if (ghost) {
						ghost = false;
						lady = true;

			imgGhost.enabled = false;
			imgLady.enabled = true;

			ipAddress.enabled = false;
			yourIpAddressLBL.enabled = false;

			playServerButton.enabled = false;
			playServerButtonImage.enabled = false;

			playClientButton.enabled = true;
			playClientButtonImage.enabled = true;

			insertIpAddressLBL.enabled = true;
			inputField.enabled = true;
			inputFieldImage.enabled = true;
				} else {
			ghost = true;
			lady = false;

			imgGhost.enabled = true;
			imgLady.enabled = false;

			ipAddress.enabled = true;
			yourIpAddressLBL.enabled = true;

			playServerButton.enabled = true;
			playServerButtonImage.enabled = true;
			
			playClientButton.enabled = false;
			playClientButtonImage.enabled = false;

			insertIpAddressLBL.enabled = false;
			inputField.enabled = false;
			inputFieldImage.enabled = false;

				}
	}
}
