コード例 #1
0
	///Adds a Yacker to the list of Yackers found
	public virtual void addYacker(Yacker y) {
		if (Player.canTouch)
		if (numYackers == 0) {	//First Yacker
			for (int x = 0; x < numProps; x++) {
				matchingProps [x] = true;
				selectedProps [x] = y.properties [x];
                TraitIndicator.get().children[x+1].color = Color.white;
            }
            numMatches = matchingProps.Length;
			yackersSelected.Add (y);
			y.GetComponent<Selectable> ().Select ();
			numYackers++;
			totalPoints ();
		} else {
			//Increase the amount of points the player will earn
			totalPoints ();
			// Sets the properties of the selector to equal the number of matching properties
			for (int x = 0; x < numProps; x++) {
				if (matchingProps [x] && selectedProps [x] != y.properties [x]) {   //Was matching prior to this new Yacker
					matchingProps [x] = false;
					selectedProps [x] = -1;
                    TraitIndicator.get().children[numMatches].color = Color.grey;
                    numMatches--;
                }
			}
				
			if (noMatches ()) { //If NONE of the properties match
				//KILL THE SELECTED AND START AGAIN
				StartCoroutine (deleteYackers ());
				y.GetComponent<Selectable> ().Deselect ();
			} else {																	//Adds it
				yackersSelected.Add (y);
				y.GetComponent<Selectable> ().Select ();
				numYackers++;
			}
		}
	}
コード例 #2
0
	//Yacker GETTER/SETTER
	public void setYacker(int x, int y, Yacker yack) {
		yackers[x, y] = yack;
	}
コード例 #3
0
	void Start() {
		yacker = GetComponent<Yacker>();
	}
コード例 #4
0
	public static void getYackers(Yacker[,] y)
	{
		allYackers = y;
	}