Пример #1
0
    public void OnSetNumber(int number)
    {
        if (IsSelected && !HasDefaultValue)
        {
            if (NoteActive && !HasWrongValue)
            {
                SetNoteSingleNumberValue(number);
            }
            else if (!NoteActive)
            {
                SetNoteNumberValue(0);
                EnteredNumber = number;
                ColorBlock colors = this.colors;

                if (EnteredNumber != CorrectNumber)
                {
                    HasWrongValue = true;

                    colors.normalColor = Color.red;
                    this.colors        = colors;

                    GameEvents.OnWrongNumberMethod();
                }
                else
                {
                    HasWrongValue   = false;
                    HasDefaultValue = true;

                    colors.normalColor = Color.white;
                    this.colors        = colors;
                }
            }
            GameEvents.CheckBoardCompletedMethod();
        }
    }