예제 #1
0
    void TurnCountDown()
    {
        turnCounting--;

        if (turnCounting > 0)
        {
            screen.setText(System.Convert.ToString(turnCounting));             //display the rest time
            if (turnCounting == 5)
            {
                if (turn == your_turn)                   //Turn on the Button
                {
                    skillButton.on((int)memory_space[your_turn - 1]);
                    inputBar.Switch(true);
                    inputBar.Select();                     //automatically select the input field for user convenience
                }
            }
        }
        else                               //failed to action in time
        {
            CancelInvoke("TurnCountDown"); //stop the loop timer
            if (turn == your_turn)
            {
                CmdInputResult(0, true);                 //time out input
            }
        }
    }