Esempio n. 1
0
        // Update the current initial we want to change
        void updateCaretIndex(int direction)
        {
            int maxInitialsCount = workingValue.Length;

            if (workingHighScore != null)
            {
                // Update the current Initials reference index; based on the Initial; set the currentSelectedCharIndex
                currentCaretIndex += direction;
                if (currentCaretIndex < 0)
                {
                    currentCaretIndex = maxInitialsCount - 1;
                }
                else if (currentCaretIndex >= maxInitialsCount)
                {
                    currentCaretIndex = 0;
                }

                string initial = workingHighScore.GetInitialAt(currentCaretIndex);

                currentSelectedCharIndex = selectableCharacters.IndexOf(initial);

                displayScore();

                if (currentSelectedCharIndex < 0)
                {
                    currentSelectedCharIndex = 0;
                }
            }
            if (updateCallbackFunc != null)
            {
                updateCallbackFunc(this.gameObject);
            }
            currentInputDelay = InputDelay;             // Reset the input delay
        }