Esempio n. 1
0
    public void Process()
    {
        switch (state)
        {
        case States.Wait:

            playerLs_time += Time.deltaTime * time_gain_rate;
            playerRs_time += Time.deltaTime * time_gain_rate;
            GetKey();
            if (time >= process_time)
            {
                tiles.Next_life1();
                draw.Draw();
                time = 0f;
            }
            break;

        case States.PlayerL:
            if (time <= select_time && action_enabled == true && playerLs_time > 0)
            {
                playerLs_time += -Time.deltaTime;
                CellClicked();
            }
            else
            {
                playerLs_time += -5;
                SetState(States.Wait);
            }
            break;

        case States.PlayerR:
            if (time <= select_time && action_enabled == true && playerRs_time > 0)
            {
                playerRs_time += -Time.deltaTime;
                CellClicked();
            }
            else
            {
                playerRs_time += -5;
                SetState(States.Wait);
            }
            break;
        }
    }
Esempio n. 2
0
    public void Process()
    {
        switch (state)
        {
        case States.Wait:
            playerLs_time += Time.deltaTime * time_gain_rate;
            playerRs_time += Time.deltaTime * time_gain_rate;
            cooltimeL     += Time.deltaTime;
            cooltimeR     += Time.deltaTime;

            GetKeyWait();
            if (time >= process_time)
            {
                tiles.Next_life1();
                draw.Draw();
                JudgeWinner();
                time = 0f;
            }
            break;

        case States.PlayerL:
            if (time <= select_time && action_enabled == true && playerLs_time > 0)
            {
                playerLs_time += -Time.deltaTime;
                GetKeyPlayer();
                CellClicked();
            }
            else
            {
                cooltimeL = -cooltime;
                SetState(States.Wait);
            }
            break;

        case States.PlayerR:
            if (time <= select_time && action_enabled == true && playerRs_time > 0)
            {
                playerRs_time += -Time.deltaTime;
                GetKeyPlayer();
                CellClicked();
            }
            else
            {
                cooltimeR = -cooltime;
                SetState(States.Wait);
            }
            break;

        case States.WinnerL:
            if (Input.anyKeyDown)
            {
                SceneManager.LoadScene(0);
            }
            break;

        case States.WinnerR:
            if (Input.anyKeyDown)
            {
                SceneManager.LoadScene(0);
            }
            break;

        default:
            break;
        }
    }