Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        BlockHeath bh = gameObject.GetComponent <BlockHeath>();

        if (bh.isDestroyed)
        {
            explode();
        }
    }
Beispiel #2
0
    private void OnTriggerEnter(Collider collision)
    {
        BlockHeath blk = collision.GetComponentInChildren <BlockHeath>();

        if (blk != null)
        {
            blk.tomarDano(dano);
            GameObject BE = Instantiate(bulletExplosion, transform.position, Quaternion.identity);
            Destroy(gameObject);
            Destroy(BE, 1f);
        }
    }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        BlockHeath bh = gameObject.GetComponent <BlockHeath>();

        if (bh.isDamaged)
        {
            animacao.SetBool("IsDamaged", true);
        }

        if (bh.isVeryDamaged)
        {
            animacao.SetBool("IsVeryDamaged", true);
        }

        if (bh.isDestroyed)
        {
            explode();
        }
    }
    // Update is called once per frame
    void Update()
    {
        BlockHeath bh = gameObject.GetComponent <BlockHeath>();

        if (bh.isDamaged && !hasBasicFire)
        {
            BF           = Instantiate(basicFire, transform.position + new Vector3(0f, 0, -0.5f), Quaternion.identity);
            hasBasicFire = true;
        }

        if (bh.isVeryDamaged && !hasIntenseFire)
        {
            IF             = Instantiate(intenseFire, transform.position + new Vector3(0f, 0, -0.5f), Quaternion.identity);
            hasIntenseFire = true;
        }

        if (bh.isDestroyed)
        {
            explode();
        }
    }
Beispiel #5
0
    // Update is called once per frame
    void Update()
    {
        BlockHeath bh = gameObject.GetComponent <BlockHeath>();

        if (bh.isDamaged && !hasFire1)
        {
            Instantiate(fogo1, transform.position + new Vector3(0.2f, 0, -0.5f), Quaternion.identity);
            hasFire1 = true;
        }

        if (bh.isVeryDamaged && !hasFire2)
        {
            Instantiate(fogo1, transform.position + new Vector3(-0.2f, 0, -0.5f), Quaternion.identity);
            hasFire2 = true;
        }

        if (bh.isDestroyed)
        {
            explode();
            ;
        }
    }