Exemplo n.º 1
0
    private void GroundSmash()
    {
        ExplosionScript.BleedCount  = SmashRangeStatistics.BleedCount;
        ExplosionScript.BleedDamage = SmashRangeStatistics.BleedDamage;
        ExplosionScript.Damage      = SmashRangeStatistics.Damage;
        ExplosionScript.Force       = SmashRangeStatistics.Force;
        ExplosionScript.Radius      = SmashRangeStatistics.Radius;

        ExplosionScript.Explode();
    }
Exemplo n.º 2
0
    /// <summary>
    /// 发射子弹的防御塔在发射时调用
    /// </summary>
    /// <param name="es"></param>
    /// <returns></returns>
    public virtual TurretAttack Shoot(EnemyScript es)
    {
        GameObject attack = Instantiate(attackPrefab);

        if (type == BULLET)
        {
            attack.transform.position = this.transform.position;

            BulletScript bs = attack.GetComponent <BulletScript>();

            bs.SetBullet(this);

            bs.flying = true;
            return(bs);
        }
        else if (type == EXPLOSION)
        {
            attack.transform.position = target.transform.position;
            ExplosionScript explode = attack.GetComponent <ExplosionScript>();

            explode.SetExplosion(this);
            explode.Explode();
        }
        else if (type == LASER)
        {
            LaserScript ls = attack.GetComponent <LaserScript>();
            ls.SetLaser(this);
            ls.Emit();
        }

        return(null);
    }
    private ExplosionScript CreateExplosion()
    {
        ExplosionScript es = Instantiate(explosionPrefab).GetComponent <ExplosionScript>();

        es.SetExplosion(this);
        es.Explode();


        return(null);
    }
Exemplo n.º 4
0
    // Update is called once per frame
    void Update()
    {
        countDown -= Time.deltaTime;

        if (countDown <= 0.0f && !hasExploded)
        {
            ExplosionScript.Explode();
            hasExploded = true;
        }
    }
Exemplo n.º 5
0
    public override void Dead()
    {
        gameObject.GetComponent <Collider>().enabled = false;

        ExplosionScript.Explode();

        Destroy(Fire);

        Destroy(gameObject);
    }