コード例 #1
0
ファイル: MainController.cs プロジェクト: Mahoney0101/GameDev
    private void OnCollisionEnter(Collision collision)
    {
        WallBrick wall = collision.gameObject.GetComponent <WallBrick>();

        if (wall != null)
        {
            wall.Destroy();
            score = PlayerPrefs.GetInt("Score", 0);
            score = score + 1;
            PlayerPrefs.SetInt("Score", score);
            if (score == 1)
            {
                playGamesScript.FirstBlock();
            }
            if (score > 49)
            {
                playGamesScript.SmashFiftyBlock();
            }
            if (score > 99)
            {
                playGamesScript.SmashHundredBlock();
            }
            if (score > 20000)
            {
                playGamesScript.Smesh();
            }
        }
        DeathPlane die = collision.gameObject.GetComponent <DeathPlane>();

        if (die != null)
        {
            adMobScript.GameOver();
            die.gameOver();
        }
    }
コード例 #2
0
 private void Hit(WallBrick caller)
 {
     passThroughCount--;
     caller.hitCallback -= Hit;
     //Debug.Log("Passthrough count = " + passThroughCount);
 }