void Start() { attempts = Instantiate(text, Vector3.zero, Quaternion.identity) as GameObject; attemptScript = attempts.GetComponent <TextScript>(); attemptScript.texture2D = attemp1; attemptScript.Hide(); if (Properties.GameType == Properties.Modes.PlayforMoney) { Scoring.Get().UpdateAttemptTexture(); } }
public void UpdateAttempts() { if (Properties.TotalAttempts <= 1) { Properties.Attempts = 0; YouLose(); } else { Properties.TotalAttempts--; Properties.Attempts++; Scoring.Get().UpdateAttemptTexture(); } }
public void ResetPlayForFun() { Properties.CurrentScore = Scoring.Get().totalScore.ToString(); if (Properties.playerScores.Count > 0) { Properties.HighestScore = Properties.playerScores [0].ToString(); if (int.Parse(Properties.CurrentScore) > int.Parse(Properties.HighestScore)) { Properties.isScoreHightest = true; } else { Properties.isScoreHightest = false; } } else { Properties.isScoreHightest = false; } Properties.playerScores.Add(Scoring.Get().totalScore); Properties.playerScores.Sort(); Properties.playerScores.Reverse(); Properties.HighestScore = Properties.playerScores [0].ToString(); if (Properties.playerScores.Count > Properties.LeaderBoardSize) { Properties.playerScores.RemoveRange(Properties.LeaderBoardSize, Properties.playerScores.Count - Properties.LeaderBoardSize); } for (int i = 0; i < Properties.playerScores.Count; i++) { PlayerPrefs.SetString("PlayerScore" + i, Properties.playerScores[i].ToString()); } PlayerPrefs.Save(); Scoring.Get().ResetScore(); StartCoroutine(ShowScoreScene()); }