예제 #1
0
    // Update is called once per frame
    void Update()
    {
        switch (state)
        {
        case STATE_AROW_MAP.DOWNLOAD_AROW_MAP:
            // stremingAssetの中のデータを使用しているので、サーバーからのダウンロードは行なっていない
            state = STATE_AROW_MAP.LOADING_AROW_MAP;
            break;

        case STATE_AROW_MAP.LOADING_AROW_MAP:
            //
            arowDemoMain.Initialize();
            SetupMenuCamera();
            state = STATE_AROW_MAP.CREATE_ROAD;
            break;

        case STATE_AROW_MAP.CREATE_ROAD:
            nodeMapHolder = arowDemoMain.CreateRoads();
            SetupNodeMapTracer();
            state = STATE_AROW_MAP.CREATE_BUILDING;
            break;

        case STATE_AROW_MAP.CREATE_BUILDING:
            if (arowDemoMain.IsEnd[MapScript.MAP_CREATE.ROAD])
            {
                arowDemoMain.CreateBuildingsNonCollider();
                state = STATE_AROW_MAP.SELECT_GOAL_POINT;
                StartBtn.gameObject.SetActive(true);
                StartBtn.interactable = false;
                mainCamera.enabled    = false;
                menuCamera.enabled    = true;
                PleaseWaitTextObj.SetActive(false);
                PlayOrderTextObj.SetActive(true);
            }

            break;

        case STATE_AROW_MAP.SELECT_GOAL_POINT:
            ClickMap();
            break;

        case STATE_AROW_MAP.READY_GAME:
            break;

        case STATE_AROW_MAP.PLAYING_GAME:
            if (nodeMapTracer.isFinished)
            {
                waitTime -= Time.deltaTime;

                if (waitTime <= 0f)
                {
                    ResetPlayingGame();         // 再度、ゴールポイント選択のStateへ
                }
            }

            break;

        default:
            Debug.Assert(false);
            break;
        }

        StatusText.text = state.ToString();
    }