using UnityEngine;
using System.Collections;

public class ClickFunction : MonoBehaviour {
	GameObject gGameController;
	GameControllerLevel01 gameController;
	[HideInInspector]
	public UISprite[] buttonInner;
	// Use this for initialization
	void Start () {
		gGameController=GameObject.FindGameObjectWithTag ("GameController");
		gameController=gGameController.GetComponent<GameControllerLevel01>();
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	public void ClkMili(){
		if(!gameController.bMili && gameController.GameState==GameControllerLevel01.WinLose.NotYet){
			gameController.bMili=true;
			gameController.PassStageChk();
			gameController.WinLoseChk();
			gameController.AnimationChk();

			buttonInner[0].enabled = false;
		}
	}

	public void ClkTech(){
		if(!gameController.bTechology && gameController.GameState==GameControllerLevel01.WinLose.NotYet){
			gameController.bTechology=true;
			gameController.PassStageChk();
			gameController.WinLoseChk();
			gameController.AnimationChk();

			buttonInner[1].enabled = false;
		}
	}

	public void ClkFood(){
		if(!gameController.bFood && gameController.GameState==GameControllerLevel01.WinLose.NotYet){
			gameController.bFood=true;
			gameController.PassStageChk();
			gameController.WinLoseChk();
			gameController.AnimationChk();

			buttonInner[2].enabled = false;
		}
	}

	public void ClkEcon(){
		if(!gameController.bEcon && gameController.GameState==GameControllerLevel01.WinLose.NotYet){
			gameController.bEcon=true;
			gameController.PassStageChk();
			gameController.WinLoseChk();
			gameController.AnimationChk();

			buttonInner[3].enabled = false;
		}
	}
}
