Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CheckIfFinished ()
- {
- if(foundations[0].GetComponent<Foundation>().CardsOnFoundation.Count == 13 &&
- foundations[1].GetComponent<Foundation>().CardsOnFoundation.Count == 13 &&
- foundations[2].GetComponent<Foundation>().CardsOnFoundation.Count == 13 &&
- foundations[3].GetComponent<Foundation>().CardsOnFoundation.Count == 13
- )
- {
- isGameFinish = true;
- isfinalizing = false;
- Generator.instance.stopUpdates = true;
- StoreEndGameResults();
- if(Hint.instance.autocomplete)
- {
- //save a winnable match
- SaveEndedGame();
- NewMatchToSave ();
- }
- else
- {
- SocialManager.instance.SendMessage("RecordAScore",(object) Points.instance.GetPoints());
- SocialManager.instance.SendMessage("UpgradeAchievement");
- ButtonsHandlerGame.instance.SetGameOverTexts(Points.instance.GetPoints().ToString(),TimerHandler.instance.GetTimeLabelText(),UndoHandler.undoHandler.moves.ToString());
- ButtonsHandlerGame.instance.ShowGameOver();
- ParticlesHandler.instance.ActiveParticles();
- // play sound
- SoundsManager.instance.PLAY_sound(SoundsManager.instance.sfx_game_over);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement