Exemple #1
0
    /// <summary>
    /// The event handler for pressing the 7-segment display.
    /// </summary>
    /// <returns>Always false, as the button does not have children.</returns>
    internal KMSelectable.OnInteractHandler NumberPress()
    {
        return(delegate()
        {
            PressFeedback(_pho.Number.transform);

            if (_init.isSolved || _init.isAnimated)
            {
                _pho.PlaySound("invalidButton");
                return false;
            }


            if (!_init.isCountingDown) // Is it inactive? Make it active.
            {
                _pho.StartCoroutine(animate.Run());
            }
            else if (!_init.isAnimated)   // Is it not animating? Continue.
            {
                if (_init.isInSubmission) // Is it in submission? Submit and validate.
                {
                    _pho.StartCoroutine(animate.ExitSubmit());
                }
                else // Otherwise, enter submission.
                {
                    EnterSubmit();
                }
            }
            return false;
        });
    }