Ejemplo n.º 1
0
    IEnumerator DeleteEnemyObject()
    {
        EnDisableFlip();
        yield return(new WaitForSeconds(.2f));

        EnAnimator.PlayDeathAnim();

        if (bossPhase != null)
        {
            bossPhase.BossDead();
        }

        yield return(new WaitForSeconds(1.0f));

        if (DeathParticlesHandler != null)
        {
            Vector3 deathParticleLocation = transform.position;
            deathParticleLocation.y -= .4f;

            DeathParticlesHandler.ShowHitEffect(deathParticleLocation);
        }

        //gameObject.SetActive(false); //TODO: set to false so that EndPortal can reference if isAlive
        stageClear.UpdateEnemyCount(100f, 50);
        Destroy(this.gameObject);
    }
Ejemplo n.º 2
0
    public virtual void Die()
    {
        isAlive = false;
        EnDisableMove();

        StopAttackCO(); //StopAllCoroutines doesn't work
        StopAllCoroutines();
        enCanAttack = false;

        if (EnAnimator != null)
        {
            EnAnimator.PlayDeathAnim();
        }

        if (DeathParticlesHandler != null)
        {
            Vector3 tempLocation = transform.position;
            tempLocation.y += hitEffectOffset;

            DeathParticlesHandler.ShowHitEffect(tempLocation);
        }

        stageClear.UpdateEnemyCount(XP, gold);

        //Delay deleting object, otherwise deathparticles or hiteffect will be interrupted
        StartCoroutine(DeleteEnemyObject());
    }
Ejemplo n.º 3
0
    void Die()
    {
        isAlive = false;
        //Die animation
        if (enAnimator != null)
        {
            enAnimator.SetTrigger("Death");
        }

        //give player exp
        //if(playerCombat != null)
        //    playerCombat.GiveXP(experiencePoints);

        //if (IsAttackingCO != null)
        //StopCoroutine(IsAttackingCO);

        StopAllCoroutines(); //stops attack coroutine if dead //TODO: make sure coroutines are saved in this script if started in Enemy.cs

        //disable enemy object

        if (DeathParticlesHandler != null)
        {
            Vector3 changeLocation = GetComponent <Transform>().position;
            Vector3 tempLocation   = changeLocation;
            tempLocation.y += .5f;
            DeathParticlesHandler.ShowHitEffect(tempLocation);
        }
        //InstantDeleteEnemyObject();
        if (!overrideDie)
        {
            StartCoroutine(DeleteEnemyObject());
        }
    }
Ejemplo n.º 4
0
    public override void Die()
    {
        isAlive = false;

        StopAllCoroutines();

        if (DeathParticlesHandler != null)
        {
            Vector3 tempLocation = transform.position;
            tempLocation.y += hitEffectOffset;

            DeathParticlesHandler.ShowHitEffect(tempLocation);
        }

        stageClear.UpdateEnemyCount(XP, gold);

        StartCoroutine(DeleteEnemyObject());
    }
Ejemplo n.º 5
0
    public override void Die() //TODO: test
    {
        //base.Die();
        StopAllCoroutines(); //stops attack coroutine if dead
        EnDisableMove();

        isAlive     = false;
        enCanAttack = false;

        ShowHealthBar(false);

        if (DeathParticlesHandler != null)
        {
            Vector3 deathParticleLocation = transform.position;
            deathParticleLocation.y += hitEffectOffset;

            DeathParticlesHandler.ShowHitEffect(deathParticleLocation);
        }

        StartCoroutine(DeleteEnemyObject());
    }