Exemplo n.º 1
0
        public Card GetNewBomb(int x, int y, PowerUps p, Vector3 position)
        {
            if (p == null)
            {
                return(null);
            }

//			string prefabKey = string.Format("{0}{1}",p.contentName,(p.color ? Card.chipTypes[id] : ""));
                        #if FightTest
            string prefabKey = "FightNew/SpecialCards/" + p.contentName;
                        #else
            string prefabKey = p.contentName;
                        #endif
            GameObject o = FightMgr.Instance.LoadAndInstantiate(prefabKey);
            o.name = p.contentName;
            o.transform.position = position;

//			Card cardExist = FightMgr.Instance.FindSlot(x, y).GetChip();
//			if (cardExist != null)
//				o.transform.position = cardExist.transform.position;

            Card chip = o.GetComponent <Card>();
            FightMgr.Instance.FindSlot(x, y).SetChip(chip);
            return(chip);
        }
Exemplo n.º 2
0
        public Card AddPowerup(int x, int y, string powerupName)
        {
            PowerUps powerup = PowerUps.powerupsNew.Find(pu => pu.name == powerupName);

            if (powerup == null)
            {
                return(null);
            }

            return(AddPowerup(x, y, powerup));
        }
Exemplo n.º 3
0
        // Make a bomb in the specified location with the ability to transform simple chips in a bomb
        public Card AddPowerup(int x, int y, PowerUps powerup)
        {
            Slot slot = FightMgr.Instance.FindSlot(x, y);
            Card chip = slot.GetChip();

            if (chip)
            {
                //DebugUtil.Debug("destroy card:" + chip.gameObject.name);
                if (chip.move)
                {
                    chip.gravity = false;
                }

                GameObject.Destroy(chip.gameObject);
            }

            chip = GetNewBomb(slot.Point.X, slot.Point.Y, powerup, slot.transform.position);
            FightMgr.Instance.ListNewPowerUp.Add(chip);
            return(chip);
        }
Exemplo n.º 4
0
        public Card GetNewBomb(int x, int y, string powerup, Vector3 position)
        {
            PowerUps p = PowerUps.powerupsNew.Find(pu => pu.name == powerup);

            return(GetNewBomb(x, y, p, position));
        }