Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        fade.FadeInFlag();

        // ゲーム開始前(ラウンド開始時)
        if (directer.GetGameState() == GAME_START)
        {
            NowRound(gameCount);
        }
        // プレイ中(制限時間)
        if (directer.GetGameState() == GAME_PLAY)
        {
            // 制限時間をうごかす
            timer.SwithGameTimer();
            // プレイヤー1が勝ったら
            if (directer.GameSet() == 1)
            {
                setRound(PLAYER1, hp1.GetNowHP());
                winChar  = 2;
                baseTime = timer.GetTimer();
                directer.GameState(GAME_END);
            }
            // プレイヤー2が勝ったら
            if (directer.GameSet() == 2)
            {
                setRound(PLAYER2, hp2.GetNowHP());
                winChar  = 1;
                baseTime = timer.GetTimer();
                directer.GameState(GAME_END);
            }
        }
        // ゲーム終了時(決着が着いた時)
        if (directer.GetGameState() == GAME_END)
        {
            // 時間経過でテキストを非表示に
            if (timer.GetTimer() - baseTime >= 2.0f)
            {
                // Textを非表示に     -> 今後演出を追加する予定
                canvasText.GetComponent <Text>().text = "";
                pause.enabled = true;                AddGameCount(gameCount);

                gameSet = false;
            }
            // いずれかのプレイヤーが勝利した時
            WinPlayer();
        }
    }