Example #1
0
    public void Combine()
    {
        if (CanCombine)
        {
            tem item = new tem();
            item = element.DeepCopy();
            bool canGet = false;
            if (item.index != 95)
            {
                for (int i = 0; i < item.Count; i++)
                {
                    PlayerItem.DestroyItem(element.SmallItemIndex[0]);
                    PlayerItem.DestroyItem(element.SmallItemIndex[1]);
                    PlayerItem.CombineItem(item.DeepCopy());
                    canGet = true;
                }
            }
            else
            {
                PlayerItem.DestroyItem(element.SmallItemIndex[0]);
                PlayerItem.DestroyItem(element.SmallItemIndex[1]);
                transform.parent.transform.parent.GetComponent <Player>().leftBullet.GetBullet(30);
                canGet = true;
            }

            if (canGet)
            {
                if (player.PlayerIndex == 6)
                {
                    transform.parent.transform.parent.GetComponent <Player>().leftBullet.GetBullet(20);
                }
                Open(item);
                starEffect.Play();
                player.CombineSound();
            }
        }
    }