Пример #1
0
 protected void Awake()
 {
     _endCanvas.enabled   = false;
     _pauseCanvas.enabled = false;
     _highScore           = FindObjectOfType <HighScoreHolder>();
     _pause = false;
 }
Пример #2
0
        private static void InitializeHighScores(bool hardInit = false)
        {
            if (highScores == null || hardInit)
            {
                highScores = new SortedSet <HighScoreHolder>(new HighScoreComparer());
            }

            for (int i = 0; i < MaxHighScoresCount; ++i)
            {
                HighScoreHolder scoreHolder = instance.GetEntry(i);

                if (scoreHolder.name != DEFAULT_NAME && scoreHolder.score != DEFAULT_SCORE)
                {
                    highScores.Add(new HighScoreHolder(
                                       scoreHolder.name, scoreHolder.score
                                       ));
                }
                else
                {
                    break;
                }
            }

            while (highScores.Count > MaxHighScoresCount)
            {
                highScores.Remove(highScores.Last());
            }
        }
Пример #3
0
 protected void Awake()
 {
     _audioSource         = GetComponent <AudioSource>();
     _scoreCanvas.enabled = false;
     _instructionsCanvas.SetActive(false);
     _highScoreHolder = FindObjectOfType <HighScoreHolder>();
     _switchCanvas    = 0;
 }
Пример #4
0
 public override bool Equals(object obj)
 {
     if ((obj == null) || !this.GetType().Equals(obj.GetType()))
     {
         return(false);
     }
     else
     {
         HighScoreHolder h2 = (HighScoreHolder)obj;
         return(this.name == h2.name && this.score == h2.score);
     }
 }
Пример #5
0
 protected void Start()
 {
     _checkHighScore = 0;
     DontDestroyOnLoad(this);
     if (_highScoreHolder == null)
     {
         _highScoreHolder = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }