void OnMouseDown() { //When clicking trash object. //if (/*this.gameObject.name == "Roska"*/ Trash == 1 && FindingTimer.timeLeft > 0) if (Trash == 1 && DifGameScript.playable) { //x = 0; //y = 2; click(); //Actions when clicked all mistake objects. //if (ClickRights == DifferenceManager.Spots /*DifferenceManager.RightClicks == 0*/) if (ClickRights == DifGameScript.spots) { Debug.Log("Last click"); FindingTimer.EndGame(); //Stop timer. //DifferenceManager.manager.PlayerWin(); //DifGameScript.gamescript.winningGame(); DifGameScript.isWin = true; //This makes level won. //DifGameScript.playable = false; Debug.Log("Virheet = " + Mistakes); } } //When clicking background. //else if (/*this.gameObject.name == "Background"*/ Trash == 0 && FindingTimer.timeLeft > 0) else if (Trash == 0 && DifGameScript.playable) { FindingTimer.timeLeft -= 3; Mistakes++; Debug.Log("Virhe!"); } }
public void onButtonClick() //This seems to be not using anymore. { if (playable) { if (spots == ClickMistake.ClickRights) { Debug.Log("You found all trashes!!!!"); FindingTimer.EndGame(); //Stop timer. //DifferenceManager.manager.PlayerWin(); //Debug.Log("Virheet = " + Mistakes); Debug.Log("Working"); } } }