Esempio n. 1
0
    protected override void InitUpStats()
    {
        base.InitUpStats();

        BulletTurret bt = (BulletTurret)turretUp;

        fireRateUp = bt.fireRate;
        slowUp     = bt.slowPercent;
        damageUp   = bt.bulletPrefab.GetComponent <Projectile>().Damage;
    }
Esempio n. 2
0
            public Menu()
                : base(128, 240)
            {
                // 设定menu层级高于MapLayer
                SetLayer(101);
                // 不锁定menu移动
                SetLocked(false);
                SetLimitMove(false);
                // 锁定Actor拖拽
                SetActorDrag(false);
                SetDelay(500);
                // 设定Menu背景
                LImage image = LImage.CreateImage(this.GetWidth(),
                                                  this.GetHeight(), true);
                LGraphics g = image.GetLGraphics();

                g.SetColor(0, 0, 0, 125);
                g.FillRect(0, 0, GetWidth(), GetHeight());
                g.SetColor(LColor.white);
                g.SetFont(15);
                g.DrawString("我是可拖拽菜单", 12, 25);
                g.Dispose();
                SetBackground(image.GetTexture());

                BulletTurret bulletTurret = new BulletTurret();

                bulletTurret.SetLocation(18, 64);


                BombTurret bombTurret = new BombTurret();

                bombTurret.SetLocation(78, 64);


                PoisonTurret poisonTurret = new PoisonTurret();

                poisonTurret.SetLocation(18, 134);


                LaserTurret laserTurret = new LaserTurret();

                laserTurret.SetLocation(78, 134);

                Button button = new Button();

                button.SetLocation(27, 196);

                // 复合LPaper到Layer
                Add(bulletTurret);
                Add(bombTurret);
                Add(poisonTurret);
                Add(laserTurret);
                Add(button);
            }
Esempio n. 3
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        //Debug.Log ("on trigered ship");

        BulletTurret bulletElement = collider.gameObject.GetComponent <BulletTurret> ();

        if (bulletElement != null)
        {
            GetHit((int)bulletElement._pvDamage, bulletElement._enumBulletType);
            Destroy(bulletElement.gameObject);
        }
    }
Esempio n. 4
0
    public static void RemoveTurret(BulletTurret bt)
    {
        if (!instance)
        {
            return;
        }

        if (instance.turrets.Count > 0)
        {
            instance.turrets.Remove(bt);
        }

        if (instance.turrets.Count < 1)
        {
            instance.gameObject.SetActive(false);
        }
    }
Esempio n. 5
0
            public Menu()
                : base(128, 240)
            {


                // 设定menu层级高于MapLayer
                SetLayer(101);
                // 不锁定menu移动
                SetLocked(false);
                SetLimitMove(false);
                // 锁定Actor拖拽
                SetActorDrag(false);
                SetDelay(500);
                // 设定Menu背景
                LImage image = LImage.CreateImage(this.GetWidth(),
                        this.GetHeight(), true);
                LGraphics g = image.GetLGraphics();
                g.SetColor(0, 0, 0, 125);
                g.FillRect(0, 0, GetWidth(), GetHeight());
                g.SetColor(LColor.white);
                g.SetFont(15);
                g.DrawString("我是可拖拽菜单", 12, 25);
                g.Dispose();
                SetBackground(image.GetTexture());

                BulletTurret bulletTurret = new BulletTurret();
                bulletTurret.SetLocation(18, 64);


                BombTurret bombTurret = new BombTurret();
                bombTurret.SetLocation(78, 64);


                PoisonTurret poisonTurret = new PoisonTurret();
                poisonTurret.SetLocation(18, 134);


                LaserTurret laserTurret = new LaserTurret();
                laserTurret.SetLocation(78, 134);

                Button button = new Button();
                button.SetLocation(27, 196);

                // 复合LPaper到Layer
                Add(bulletTurret);
                Add(bombTurret);
                Add(poisonTurret);
                Add(laserTurret);
                Add(button);
            }
 public static void MakeBulletSpecial(BulletTurret bt)
 {
     instance.bulletBtn.SetActive(true);
     BulletSpecial.AddNewBulletTurret(bt);
 }
Esempio n. 7
0
 public static void AddNewBulletTurret(BulletTurret bt)
 {
     instance.turrets.Add(bt);
 }