private void UpdateWeaponPartTip(int id, Transform transform)
        {
            if (id <= 0)
            {
                tipManager.UnRegisterTip(transform);
                return;
            }

            var data = new TipShowData();

            data.CategoryId = (int)ECategory.WeaponPart;
            data.TemID      = id;
            tipManager.RegisterTip <CommonItemTipModel>(transform, data);
        }
        private void UpdateWeaponTip(IWeaponBagItemInfo item, WeaponBagUiItem uiItem)
        {
            var transform = uiItem.WeaponIcon.transform;

            if (item == null || item.id <= 0)
            {
                tipManager.UnRegisterTip(transform);
                return;
            }

            var id = item.id;

            if (id <= 0)
            {
                return;
            }
            var data = new TipShowData();

            data.CategoryId = (int)ECategory.Weapon;
            data.TemID      = id;
            tipManager.RegisterTip <CommonItemTipModel>(transform, data);
        }
Esempio n. 3
0
        private void ShowItemTip(object data, Transform targetTf)
        {
            if (canvas == null)
            {
                var canvasArray = this.FindAllComponents <Canvas>();
                if (canvasArray.Length > 0)
                {
                    canvas = canvasArray[0];
                    canvas.overrideSorting = true;
                    canvas.sortingOrder    = 1000;
                }
            }

            var showData = data as TipShowData;

            if (showData != null && _viewInitialized)
            {
                curShowTipData = showData;
                Refresh();
            }
            //HidePos();
            this.SetVisible(true);
        }