Example #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        BulletSpecial bullet = collision.GetComponent <BulletSpecial>();

        if (bullet != null)
        {
            Destroy(gameObject);
        }
    }
Example #2
0
    void CheckTurretTypeToSell()
    {
        //bullet
        if (turret.GetComponent <BulletTurret>())
        {
            BulletSpecial.RemoveTurret(turret.GetComponent <BulletTurret>());
        }

        //missile
        else if (turret.GetComponent <MissileTurret>())
        {
            MissileSpecial.RemoveTurret(turret.GetComponent <MissileTurret>());
        }

        //railgun
        else if (turret.GetComponent <RailgunTurret>())
        {
            RailgunSpecial.RemoveTurret(turret.GetComponent <RailgunTurret>());
        }

        //laser
        else if (turret.GetComponent <LaserTurret>())
        {
            LaserSpecial.RemoveTurret(turret.GetComponent <LaserTurret>());
        }

        //tesla
        else if (turret.GetComponent <TeslaTurret>())
        {
            TeslaSpecial.RemoveTurret(turret.GetComponent <TeslaTurret>());
        }

        //fire
        else if (turret.GetComponent <FireTurret>())
        {
            FireSpecial.RemoveTurret(turret.GetComponent <FireTurret>());
        }

        //tank
        else if (turret.GetComponent <TankTurret>())
        {
            TankSpecial.RemoveTurret(turret.GetComponent <TankTurret>());
        }

        //farm
        else if (turret.GetComponent <FarmTower>())
        {
            FarmSpecial.RemoveTower(turret.GetComponent <FarmTower>());
        }

        else if (turret.GetComponent <WindTurret>())
        {
            WindSpecial.RemoveTurret(turret.GetComponent <WindTurret>());
        }
    }
Example #3
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Brick brick = collision.GetComponent <Brick>();

        if (brick != null)
        {
            brick.TakeDamage(1);
        }
        BulletSpecial bullet = collision.GetComponent <BulletSpecial>();

        //Debug.Log(collision.name);
        Destroy(gameObject);
    }
 public static void MakeBulletSpecial(BulletTurret bt)
 {
     instance.bulletBtn.SetActive(true);
     BulletSpecial.AddNewBulletTurret(bt);
 }
Example #5
0
 void Awake()
 {
     instance = this;
     turrets  = new List <BulletTurret>();
     num.gameObject.SetActive(false);
 }