コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        timedEventPlanner.StepEvents(Time.deltaTime);
        if (!freeze)
        {
            Vector3 worldPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
            switch (gameState)
            {
            case GameState.WaitMove: WaitMove(worldPos); break;

            case GameState.CheckMove: CheckMove(worldPos); break;

            case GameState.SolveMove: SolveMove(); break;

            case GameState.ReverseMove: ReverseMove(); break;

            case GameState.FlushBoard: FlushBoard(); break;

            case GameState.GameOver: GameOver(); break;

            case GameState.WonTimeLimit: GameLimitWon(); break;
            }
        }

        CleanFrame();
        float timeLeftClamp = Mathf.Clamp((timeLimit - timeLeftEvent.GetSeconds()), 0, timeLimit);

        gameDataProvider.gameData.SetInt(GameData.TIMELEFT, (int)timeLeftClamp);
    }