Esempio n. 1
0
 public void EnableInputField()
 {
     if (SaveClass.GetGameOver())
     {
         gameObject.SetActive(true);
     }
 }
Esempio n. 2
0
    /// <summary>
    /// ブロック生成が可能なら生成する
    /// </summary>
    private void Update()
    {
        // ゲーム開始かつ
        if (CountdownText.IsGameStart())
        {
            // ゲームオーバーになっていないとき
            if (!SaveClass.GetGameOver())
            {
                CreateBlockCount += Time.deltaTime;

                // ブロック生成基準時間を生成カウントが越したとき
                if (CreateBlockCount > (CreateBlockTime - AdminCreateBlockTime))
                {
                    Debug.Log("\nCreateBlockCount_:" + CreateBlockCount + "\nCreateBlockTime_:" + CreateBlockTime + "\nAdminCreateBlockTime_:" + AdminCreateBlockTime + "\nCreateBlockTime - AdminCreateBlockTime_:" + (CreateBlockTime - AdminCreateBlockTime));

                    // 移動先の決定
                    var fab = DecideMovePoint(out Vector3 ToPosition);

                    // 生成移動コルーチンスタート
                    StartCreate = StartCoroutine(MoveBlocks(ToPosition, fab));

                    // 生成カウントを減少させるか否か
                    AdminCreateBlockTime = ShortenCreateBlockTime();

                    // 生成カウントリセット
                    CreateBlockCount = 0.0f;
                }
            }
        }
    }
Esempio n. 3
0
    /// <summary>
    /// なんちゃってリザルト画面
    /// </summary>
    public void GotoResultScene()
    {
        // ゲームモードがNormalの場合
        if (SaveClass.GetGameMode())
        {
            // ブロックをすべて消したら
            if (SaveClass.GetIsClear())
            {
                Destroy(ball.gameObject);

                // ゲームクリアテキストの表示
                gameClearText.GetComponent <Text>().enabled = true;

                // ボタンを出す
                CreateButton();
            }

            // 玉が画面外に出たら
            if (!ball.GetComponent <Renderer>().isVisible)
            {
                // 玉を削除
                Destroy(ball.gameObject);
                // ゲームオーバーテキストの表示
                gameOverText.GetComponent <Text>().enabled = true;

                // ボタンを出す
                CreateButton();
            }
        }
        // ゲームモードがInfiniteの場合
        else
        {
            var  ResultScore = ball.DeleteCount * 100;
            bool CanOnlyOnce = false;

            if (!SaveClass.GetGameOver())
            {
                // 玉が画面外に出たら
                if (!ball.GetComponent <Renderer>().isVisible&& !CanOnlyOnce)
                {
                    // 一度きりフラグを折る
                    CanOnlyOnce = true;

                    // ゲームオーバーテキストの表示
                    gameOverTextInfinite.text = ("Game Over\n\nYour Score:" + ResultScore + "\n\nTap to Retry!!");
                    gameOverTextInfinite.GetComponent <Text>().enabled = true;
                }

                foreach (Transform childTransform in blocks.transform)
                {
                    // アクティブなブロックが外に出たら
                    if (!childTransform.GetComponent <Renderer>().isVisible&& childTransform.GetComponent <PrefabStatus>().GetIsActive() && !CanOnlyOnce)
                    {
                        // 一度きりフラグを折る
                        CanOnlyOnce = true;

                        // ゲームオーバーテキストの表示
                        gameOverTextInfinite.text = ("Game Over\n\nYour Score:" + ResultScore + "\n\nTap to Retry!!");
                        gameOverTextInfinite.GetComponent <Text>().enabled = true;
                    }
                }
            }

            // 一度だけ通ってほしいゲーム終了処理
            if (CanOnlyOnce)
            {
                SaveClass.SetGameOver(true);

                // 玉を削除
                Destroy(ball.gameObject);

                // save
                SaveClass.StorePlayerScore(ResultScore);

                // 通信中は何も受け付けないように
                if (!ServerIsBusy)
                {
                    StartCoroutine(WaitServerProcess());
                }
            }
        }
    }