void SaveHightScore(HightScore hightScore) { HightScore[] hightScores = new HightScore[4]; hightScores[0] = hightScore; hightScores[1] = new HightScore() { Name = game3.Properties.Settings.Default.Name1, Score = game3.Properties.Settings.Default.Score1 }; hightScores[2] = new HightScore() { Name = game3.Properties.Settings.Default.Name2, Score = game3.Properties.Settings.Default.Score2 }; hightScores[3] = new HightScore() { Name = game3.Properties.Settings.Default.Name3, Score = game3.Properties.Settings.Default.Score3 }; Array.Sort <HightScore>(hightScores, (x, y) => x.Score.CompareTo(y.Score)); Array.Reverse(hightScores); game3.Properties.Settings.Default.Score1 = hightScores[0].Score; game3.Properties.Settings.Default.Name1 = hightScores[0].Name; game3.Properties.Settings.Default.Score2 = hightScores[1].Score; game3.Properties.Settings.Default.Name2 = hightScores[1].Name; game3.Properties.Settings.Default.Score3 = hightScores[2].Score; game3.Properties.Settings.Default.Name3 = hightScores[2].Name; game3.Properties.Settings.Default.Save(); }
public void Cost() { gameOver.SetActive(true); player.SetActive(false); Invoke("Invok", 0.5f); HightScore.HightCoin(); HightScore.HightScoreCounter(); }
public void BackMenu() { activeEndPanel.SetActive(true); EndGame.coin = cost; EndGame.two = HudScr.scoreCounter; EndGame.three = HightScore.scoreHightCounter; Missions.SavedPlayerPrefs(); HightScore.HightCoin(); HightScore.HightScoreCounter(); Exit(); }
public void Event() { HightScore.HightCoin(); HightScore.HightScoreCounter(); GameObject.FindGameObjectWithTag("VisibleMagnet").GetComponent <MagnetVisible>().StopMagn(); MagnetVisible.magnetTest = false; player.SetActive(false); gameOver.SetActive(true); Invoke("Invok", 0.5f); }