void checkCorrectItems() { if (this.selectedMakeup != KateMakeup.none && this.selectedDress != KateDress.none && this.selectedShoe != KateShoe.none && this.selectedAccessory != KateAccessory.none) { this.overlay.SetActive(true); int correctItems = 0; if (this.selectedMakeup == this.correctMakeup) { correctItems++; } if (this.selectedDress == this.correctDress) { correctItems++; } if (this.selectedShoe == this.correctShoe) { correctItems++; } if (this.selectedAccessory == this.correctAccessory) { correctItems++; } string speech = "Yes, I think this is the correct outfit!"; if (correctItems == 4) // Win game { this.kateFSM.SendEvent("wonDressPuzzle"); } else { string parts = (correctItems == 1) ? "part" : "parts"; speech = "I like " + correctItems + " " + parts + " of this outfit."; this.kateFSM.SendEvent("resetDressPuzzle"); this.selectedMakeup = KateMakeup.none; this.selectedAccessory = KateAccessory.none; this.selectedDress = KateDress.none; this.selectedShoe = KateShoe.none; } this.bubbleText.text = speech; this.bubbleFSM.SendEvent("activate"); } }
public void setMakeup(KateMakeup makeup) { this.selectedMakeup = makeup; checkCorrectItems(); }