/// <summary>
        /// Checks if the player is sorting the number correctly
        /// </summary>
        /// <param name="s"></param>
        private void CheckOrder(string s)
        {
            if (char.Parse(s) == alphabeticOrder[index])
            {
                index++;

                // Successfully finishes the mini challenge
                if (index >= 6)
                {
                    OnPlayerSuccess?.Invoke();
                    ButtonBehaviour.OnButtonPressed -= CheckOrder;
                    index = 0;
                }
            }
            else
            {
                index = 0;
                OnPlayerMiss?.Invoke();
            }
        }
Exemple #2
0
        /// <summary>
        /// Checks if the player is sorting the number correctly
        /// </summary>
        /// <param name="num"></param>
        private void CheckOrder(string num)
        {
            if (int.Parse(num) == numArray[index])
            {
                index++;

                // Successfully finishes the mini challenge
                if (index >= 10)
                {
                    OnPlayerSuccess?.Invoke();
                    ButtonBehaviour.OnButtonPressed -= CheckOrder;
                    index = 0;
                }
            }
            else
            {
                index = 0;
                OnPlayerMiss?.Invoke();
            }
        }