Beispiel #1
0
    void gameOverJudge()
    {
        if (healthBar.Health <= damageVolume)
        {
            Vector3 playerDestroyPosition = transform.position + new Vector3(0, 0, 2.5f);
            // 爆発用インスタンスを生成.
            Instantiate(playerDestroy, playerDestroyPosition, Quaternion.identity);

            textureBottomScript = GameObject.Find("RunwayBottom").GetComponent <textureControllerBottom>();
            textureTopScript    = GameObject.Find("RunwayTop").GetComponent <textureControllerTop>();
            textureLeftScript   = GameObject.Find("RunwayLeft").GetComponent <textureControllerSide>();
            textureRightScript  = GameObject.Find("RunwayRight").GetComponent <textureControllerSide>();

            textureBottomScript.stopScroll = true;
            textureTopScript.stopScroll    = true;
            textureLeftScript.stopScroll   = true;
            textureRightScript.stopScroll  = true;

            // 照明を消す.
            pointLightBase.SetActive(false);
            pointLightPlus.SetActive(false);

            // ゲームオーバー用のテキストのプレハブをインスタンス化.
            Instantiate(gameOverPrefab, new Vector3(0.3f, 2.5f, 0), Quaternion.identity);

            // 自分自身を破棄.
            Destroy(gameObject);
        }
    }
Beispiel #2
0
    void gameOverJudge()
    {
        if ( healthBar.Health <= damageVolume ) {

            Vector3 playerDestroyPosition = transform.position + new Vector3(0, 0, 2.5f);
            // 爆発用インスタンスを生成.
            Instantiate( playerDestroy, playerDestroyPosition, Quaternion.identity );

            textureBottomScript = GameObject.Find("RunwayBottom").GetComponent<textureControllerBottom>();
            textureTopScript = GameObject.Find("RunwayTop").GetComponent<textureControllerTop>();
            textureLeftScript = GameObject.Find("RunwayLeft").GetComponent<textureControllerSide>();
            textureRightScript = GameObject.Find("RunwayRight").GetComponent<textureControllerSide>();

            textureBottomScript.stopScroll = true;
            textureTopScript.stopScroll = true;
            textureLeftScript.stopScroll = true;
            textureRightScript.stopScroll = true;

            // 照明を消す.
            pointLightBase.SetActive(false);
            pointLightPlus.SetActive(false);

            // ゲームオーバー用のテキストのプレハブをインスタンス化.
            Instantiate( gameOverPrefab, new Vector3(0.3f, 2.5f, 0), Quaternion.identity );

            // 自分自身を破棄.
            Destroy(gameObject);

        }
    }