//Actions when loading level. private void OnLevelWasLoaded(int level) { FindingTimer.StartGame(); //Restart timer. ClickMistake.StartClicks(); ////Zero mistake clicks. Debug.Log("Load"); }
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"); } } }
public void Replay() { //MusicPlayer.instance.PlaySoundEffect(MusicPlayer.instance.menuOk, 1); Application.LoadLevel(Application.loadedLevel); //Reload opened scene. //Restart = 1; FindingTimer.StartGame(); //Restart timer. ClickMistake.StartClicks(); ////Zero mistake clicks. Restart = 1; //Return number of clicks back to defined starting number. //Redo to UI function //Pauseimg.SetActive(false); }
void OnLevelWasLoaded(int level) { //------------------------------------------------------------------------ //Defines required clics/removable objects number (when opening level from LevelSelect scene). if (level == 12 || level == 13) { DifferenceInitialPanel(); } if (level == 12) { currentLevel = 0; Debug.Log("Current level = " + currentLevel); //RightClicks = 2; Spots = 2; //TimerLevel = 2; FindingTimer.timeLeft = 20; Debug.Log("Spots = " + Spots); } if (level == 13) { currentLevel = 1; Debug.Log("Current level = " + currentLevel); //RightClicks = 3; Spots = 3; //TimerLevel = 3; FindingTimer.timeLeft = 30; Debug.Log("Spots = " + Spots); } if (level == 1) { //currentLevel = 2; } else { } //------------------------------------------------------------------------ //TimeAndClicks.StartGame(); //Restart timer and zero clicks. FindingTimer.StartGame(); //Restart timer. ClickMistake.StartClicks(); ////Zero mistake clicks. //Debug.Log("IIIII"); }