Esempio n. 1
0
    /// <summary>
    /// 创建一个格子  by吴江
    /// </summary>
    /// <param name="_index"></param>
    void AddOneGrid(int _index)
    {
        if (girdDic.ContainsKey(_index))
        {
            girdDic[_index].FillInfo(null);
            girdDic[_index].gameObject.SetActive(true);
            return;
        }
        ItemUI go = null;

        if (itemPrefab != null)
        {
            go = ItemUI.CreatNewByPrefab(GridMgr, _index, itemPrefab.gameObject);
        }
        else
        {
            go = ItemUI.CreatNew(GridMgr, _index, triggerGridFrame ? GridMgr.gameObject : null);
        }
        if (go != null)
        {
            go.ShowTooltip   = ShowToolTip;
            go.showZeroCount = showZeroCount;
            go.showUIType    = showUIType;
            go.SetActionBtn(leftAction, middleAction, rightAction);
            go.FillInfo(null);
            go.OnSelectEvent += OnSelectItemUI;
            girdDic[_index]   = go;
        }
    }
Esempio n. 2
0
 public void CreatItem()
 {
     if (parent != null)
     {
         item = ItemUI.CreatNew(parent, Vector3.zero, Vector3.one);
     }
 }
Esempio n. 3
0
    /// <summary>
    /// 物品小于10的时候放到特效里面
    /// </summary>
    void CreateItemLessThan10()
    {
        HideUipel();
        if (fxAfterOpen != null)
        {
            NsEffectManager.RunReplayEffect(fxAfterOpen, true);
        }
        coinGo.SetActive(true);
        ReleaseGrid();

        List <int> idList = GameCenter.treasureHouseMng.idList;

        for (int i = 0, max = items.Count; i < max; i++)
        {
            if (idList.Count > i)
            {
                items[i].SetActive(true);
                ItemUI itemUI = ItemUI.CreatNew(items[i].transform, Vector3.zero, Vector3.one);
                if (itemUI != null)
                {
                    itemUI.FillInfo(new EquipmentInfo(idList[i], 1, EquipmentBelongTo.PREVIEW));
                }
            }
            else
            {
                items[i].SetActive(false);
            }
        }
    }
Esempio n. 4
0
    void ShowItem()
    {
        if (fxAfterOpen != null)
        {
            NsEffectManager.RunReplayEffect(fxAfterOpen, true);
            switch (infoList.Count)
            {
            case 1:
                fxAfterOpen.transform.localPosition = new Vector3(156, 30, 0);
                break;

            case 2:
                fxAfterOpen.transform.localPosition = new Vector3(124, 30, 0);
                break;

            case 3:
                fxAfterOpen.transform.localPosition = new Vector3(75, 30, 0);
                break;

            case 4:
                fxAfterOpen.transform.localPosition = new Vector3(55, 30, 0);
                break;

            case 5:
                fxAfterOpen.transform.localPosition = new Vector3(0, 30, 0);
                break;

            default:
                fxAfterOpen.transform.localPosition = new Vector3(0, 56, 0);
                break;
            }
        }
        if (okBtn != null)
        {
            okBtn.gameObject.SetActive(true);
        }
        if (nameLabel != null)
        {
            nameLabel.gameObject.SetActive(true);
        }
        for (int i = 0, max = items.Count; i < max; i++)
        {
            if (infoList.Count > i)
            {
                items[i].SetActive(true);
                ItemUI itemUI = ItemUI.CreatNew(items[i].transform, Vector3.zero, Vector3.one * 0.5f);
                if (itemUI != null)
                {
                    itemUI.FillInfo(infoList[i]);
                }
            }
            else
            {
                items[i].SetActive(false);
            }
        }
    }
Esempio n. 5
0
    /// <summary>
    /// 初始化添加物品
    /// </summary>
    void AddItem()
    {
        int index = 0;

        if (grid != null)
        {
            //Debug.Log("数量为"+GameCenter.inventoryMng.BoxGotItems.Count);
            for (int i = 0, max = GameCenter.inventoryMng.BoxGotItems.Count; i < max; i++)
            {
                ItemUI go = ItemUI.CreatNew(grid, index);
                go.FillInfo(GameCenter.inventoryMng.BoxGotItems[i]);
                index++;
            }
        }
    }
Esempio n. 6
0
 public void SetData(st.net.NetBase.lucky_wheel_reward_info _info)
 {
     if (parent != null && item == null)
     {
         item = ItemUI.CreatNew(parent, Vector3.zero, Vector3.one);
     }
     if (item != null)
     {
         item.FillInfo(new EquipmentInfo((int)_info.item_type, (int)_info.amount, EquipmentBelongTo.PREVIEW));
     }
     if (basicDes != null)
     {
         basicDes.gameObject.SetActive(_info.wheel_type == 1);
     }
     if (advanceDes != null)
     {
         advanceDes.gameObject.SetActive(_info.wheel_type == 2);
     }
     if (advanceSp != null)
     {
         advanceSp.gameObject.SetActive(_info.wheel_type == 2);
     }
 }