Exemplo n.º 1
0
    public static void ShowItem(int itemId, Transform root = null)
    {
        if (root == null)
        {
            root = UINodesManager.TopUIRoot;
        }
        Items item = BackpackManager.Instance.GetItem(itemId);

        if (item == null)
        {
            return;
        }
        if (item.tab == 2)
        {
            int depthValue = 14000;
            if (root != null)
            {
                Canvas componentInParent = root.GetComponentInParent <Canvas>();
                if (componentInParent != null)
                {
                    depthValue = componentInParent.get_sortingOrder();
                }
            }
            EquipCompareTipUI equipCompareTipUI = UIManagerControl.Instance.OpenUI("EquipCompareTipUI", root, false, UIType.NonPush) as EquipCompareTipUI;
            equipCompareTipUI.RefreshUI(itemId, depthValue);
        }
        else
        {
            UIManagerControl.Instance.OpenUI("ItemTipUI", root, false, UIType.NonPush);
            ItemTipUIViewModel.Instance.Refresh(itemId);
        }
    }
Exemplo n.º 2
0
    public static void ShowEquipItem(int itemID, long equipUId = 0L, Transform root = null)
    {
        int depthValue = 14000;

        if (root == null)
        {
            root = UINodesManager.TopUIRoot;
        }
        else
        {
            Canvas componentInParent = root.GetComponentInParent <Canvas>();
            if (componentInParent != null)
            {
                depthValue = componentInParent.get_sortingOrder();
            }
        }
        if (BackpackManager.Instance.GetItem(itemID) == null)
        {
            return;
        }
        EquipCompareTipUI equipCompareTipUI = UIManagerControl.Instance.OpenUI("EquipCompareTipUI", root, false, UIType.NonPush) as EquipCompareTipUI;

        equipCompareTipUI.RefreshUI(itemID, equipUId, depthValue);
    }