Ejemplo n.º 1
0
    public void initGetItemEffect(Vector2 originPosInGlobal, string itemId)
    {
        NewItem copyView = (NewItem)UIPackage.CreateObject("UIMain", "NewItem").asCom;

        copyView.init(itemId);
        showGetItemEffect(originPosInGlobal, copyView);
    }
Ejemplo n.º 2
0
    public void initGetItemEffect(List <string> itemIds)
    {
        Vector2 center = new Vector2(GRoot.inst.width / 2, GRoot.inst.height / 2);

        center.x -= (int)(itemIds.Count * 0.5f * 160);

        for (int i = 0; i < itemIds.Count; i++)
        {
            NewItem copyView = (NewItem)UIPackage.CreateObject("UIMain", "NewItem").asCom;
            copyView.init(itemIds[i]);
            showGetItemEffect(center + new Vector2(160 * i, i % 2 * 10), copyView);
        }
    }
Ejemplo n.º 3
0
    protected override void OnShown()
    {
        _new_item_list.ClearSelection();
        _new_item_list.RemoveChildrenToPool();


        for (int i = 0; i < items.Count; i++)
        {
            NewItem item = (NewItem)_new_item_list.AddItemFromPool();


            item.init(items[i]);
            item.onClick.Add(delegate() {
                if (_new_item_list.selectedIndex != -1)
                {
                    _confirm.visible = true;
                }
                if (PlayerData.getInstance().guideStage == 10)
                {
                    GuideManager.getInstance().showGuideConfirmChooseItem();
                    PlayerData.getInstance().guideStage = 11;
                }
            });
            item.GetChild("detail").onTouchBegin.Add(delegate() {
                //Debug.Log("Show Detail");
            });
        }


        _confirm.visible = false;

        if (PlayerData.getInstance().guideStage == 4)
        {
            GuideManager.getInstance().showGuideChooseItem();
            PlayerData.getInstance().guideStage = 10;
        }
    }