コード例 #1
0
    private void Update()
    {
        GameScore     += Time.deltaTime * player.Speed;
        scoreText.text = "SCORE: " + (int)GameScore;

        GameTime     += Time.deltaTime;
        timeText.text = (int)GameTime + "(time) x " + player.Speed + "(speed)";

        int randMax = Mathf.Min(6, 2 + (int)(GameTime / 3));


        if (!obstacleController.CreateFlg)
        {
            switch (Random.Range(1, randMax))
            {
            case 1:
                StartCoroutine(obstacleController.CreateObstacle());
                break;

            case 2:
                StartCoroutine(obstacleController.CreateFloor2());
                break;

            case 3:
                StartCoroutine(obstacleController.CreateFloor3());
                break;

            case 4:
                StartCoroutine(obstacleController.CreateFloor4());
                break;

            case 5:
                StartCoroutine(obstacleController.CreateFloor5());
                break;
            }
        }

        // if(GameTime > 60)
        // {
        //     if(!obstacleController.Floor2Flg)
        //         StartCoroutine(obstacleController.CreateFloor2());
        // }
        // else if(!obstacleController.ObstacleFlg)
        // {
        //     StartCoroutine(obstacleController.CreateObstacle());
        // }
    }