Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        flyerScript      = GameObject.FindWithTag("Player").GetComponent <AutoFly_Advanced>();
        menuObject       = GameObject.FindWithTag("MenuObject");
        highScoresObject = GameObject.FindWithTag("HighScoreBoard");
        highScoreText    = GameObject.FindWithTag("HighScoreHolder").GetComponent <TextMesh>();
        //game over will be set to false when calling StartGame method
        gameOver          = true;
        score             = 0;
        currentEnemyCount = 0;
        highScoresObject.SetActive(false);

        if (restart)
        {
            //just start the game without showing the menu
            this.startGame();
            //hide the Menu
            menuObject.SetActive(false);
        }
        else
        {
            //show the START BUTTON
            menuObject.transform.GetChild(0).gameObject.SetActive(true);
            //hide the RESTART BUTTON
            menuObject.transform.GetChild(1).gameObject.SetActive(false);
            //show the Menu
            menuObject.SetActive(true);
            scoreText.text = "";
            enemyText.text = "";
        }
    }
Exemplo n.º 2
0
    public void PlayerDied()
    {
        AutoFly_Advanced scriptFly = player.GetComponent(typeof(AutoFly_Advanced)) as AutoFly_Advanced;

        scriptFly.stopFlying();

        gameController.GameOver();
        GameObject.FindWithTag("AttackController").GetComponent <AttackControllerScript>().endedGaze();

        Instantiate(explosion, transform.position, transform.rotation);
        gameObject.SetActive(false);
    }