示例#1
0
    void Start()
    {
        LaserSound = GetComponent <AudioSource>();
        GameObject deathStarHPObject = GameObject.FindWithTag("DeathStarHP");

        if (deathStarHPObject != null)
        {
            DeathStarHP = deathStarHPObject.GetComponent <DeathStarHPController>();
        }
        deathStarSpriteRenderer = GetComponent <SpriteRenderer>();
        shieldLevel             = 2;
        fireRate = 2.5f;
    }
    // Start is called before the first frame update
    void Start()
    {
        restart           = false;
        gameOver          = false;
        GameOverText.text = "";
        RestartText.text  = "";
        GameObject deathStarHPObject = GameObject.FindWithTag("DeathStarHP");

        if (deathStarHPObject != null)
        {
            DeathStarHP = deathStarHPObject.GetComponent <DeathStarHPController>();
        }
        Invoke("SpawnTIEFighter", 2);
        score = 0;
        tie_destroyed_counter  = 0;
        star_destroyer_counter = 1;
        UpdateScore();
    }