protected override void Update()
    {
        base.Update();
        FlipSprite();
        shield.transform.Rotate(0, 0, 50 * Time.deltaTime);
        if (!battleEnding && currentHealth <= phases[currentPhase].healthToEndPhase)
        {
            if (phases[currentPhase].removeAtPhaseEnd)
            {
                phases[currentPhase].removeAtPhaseEnd.SetActive(false);
            }
            if (phases[currentPhase].addAtPhaseEnd && phases[currentPhase].newSpawnPoint && currentPhase == 0)
            {
                if (doOnce)
                {
                    StartCoroutine(BossMinion.DestroyMinion(minion, phases[currentPhase].addAtPhaseEnd));
                    doOnce = false;
                }
            }

            if (GameManager.instance)
            {
                GameManager.instance.AddScore(phases[currentPhase].score);
            }
            currentPhase++;
        }
        else if (phases[currentPhase].phaseShot != null)
        {
            foreach (BattleShot shot in phases[currentPhase].phaseShot)
            {
                shot.shotCounter -= Time.deltaTime;
                if (shot.shotCounter <= 0)
                {
                    shot.shotCounter = shot.timeBetweenShots;
                    Instantiate(shot.shot, shot.firePoint.transform.position,
                                Quaternion.Euler(shot.firePoint.transform.position));
                }
            }
        }
    }
Ejemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     touched = 0;
     bScript = bigboi.GetComponent <BossScript>();
     pscript = transform.parent.gameObject.GetComponent <BossMinion>();
 }