Exemplo n.º 1
0
	public void notify(Tile tile){

		//Debug.Log ("Notify was called " + isFirstPlayerTurn);
		if (isFirstPlayerTurn) {
			p1Selected = tile;
		} else {
			p2Selected = tile;
			inEnable = false;

			bool isMatch = p1Selected.checkPair (p2Selected);

			if (isMatch) {
				p1Selected.match ();
				p2Selected.match ();
				winCount -= 2;
				inEnable = true;
				//Debug.Log ("Matched! " + isMatch);
			} else {
				StartCoroutine(unSelectAfterDelay());
				//Debug.Log ("No match! " + isMatch);
			}
		}
		isFirstPlayerTurn = !isFirstPlayerTurn;
	}