/// <summary> /// 需要展示详细属性的调这个,比如在背包里 /// </summary> /// <param name="itemFielInfo">Item fiel info.</param> /// <param name="myParent">My parent.</param> public void Show(ItemFielInfo itemFielInfo, PackInfoPanel myParent) { m_PackRightBtnManager.gameObject.SetActive(true); HasClik = false; bool ShowPathLinkBtn = false; this.MyParent = myParent; CurrentItem = itemFielInfo; TweenAlpha.Begin(m_PackRightBtnManager.gameObject, 0.1f, 0, 1, null); TweenPosition.Begin(m_PackRightBtnManager.gameObject, 0.1f, m_PackRightBtnManager.transform.localPosition, RightBtnShowPos); transform.localPosition = new Vector3(0, 0, -150); InitButton(itemFielInfo); switch (itemFielInfo.LocalItemData._GoodsClass) { case 1: //装备显示 bool isEquiptItem = ContainerInfomanager.Instance.GetEquiptItemList().FirstOrDefault(P => P == itemFielInfo) != null; if (isEquiptItem) { if (EquiptItemTips_equipt == null) { EquiptItemTips_equipt = CreatObjectToNGUI.InstantiateObj(EquiptItemTipsPrefab, transform).GetComponent <ItemInfoTips_Equipment>(); } EquiptItemTips_equipt.Show(itemFielInfo, true, true, ShowPathLinkBtn); } else { if (EquiptItemTips_normal == null) { EquiptItemTips_normal = CreatObjectToNGUI.InstantiateObj(EquiptItemTipsPrefab, transform).GetComponent <ItemInfoTips_Equipment>(); } EquiptItemTips_normal.Show(itemFielInfo, false, false, ShowPathLinkBtn); ItemFielInfo equiptPairItem = ContainerInfomanager.Instance.GetEquiptItemList().FirstOrDefault (P => (P.LocalItemData as EquipmentData)._vectEquipLoc == (itemFielInfo.LocalItemData as EquipmentData)._vectEquipLoc); if (equiptPairItem != null) { if (EquiptItemTips_equipt == null) { EquiptItemTips_equipt = CreatObjectToNGUI.InstantiateObj(EquiptItemTipsPrefab, transform).GetComponent <ItemInfoTips_Equipment>(); } EquiptItemTips_equipt.Show(equiptPairItem, true, true, ShowPathLinkBtn); } } break; case 2: if (itemFielInfo.LocalItemData._GoodsSubClass == 4) { //if(GiftPanelItemtips!=null){Destroy(GiftPanelItemtips);} if (GiftPanelItemtips == null) { GiftPanelItemtips = CreatObjectToNGUI.InstantiateObj(GiftItemTipsPrefab, transform).GetComponent <GiftPanel>(); } GiftPanelItemtips.Show(itemFielInfo); GiftPanelItemtips.CallBackOnSellClick = OnButtonClick; GiftPanelItemtips.CallBackOnCloseHandle = Close; } else { if (MedicineItemtips == null) { MedicineItemtips = CreatObjectToNGUI.InstantiateObj(MedicineItemTipsPrefab, transform).GetComponent <ItemInfoTips_Medicine>(); } MedicineItemtips.Show(itemFielInfo); } break; case 3: if (itemFielInfo.LocalItemData._GoodsSubClass == 3) { if (EquiptItemTips_Jewel == null) { EquiptItemTips_Jewel = CreatObjectToNGUI.InstantiateObj(JewelItemTipsPrefab, transform).GetComponent <ItemInfoTips_Jewel>(); } EquiptItemTips_Jewel.Show(itemFielInfo, true, true); } else { if (MedicineItemtips == null) { MedicineItemtips = CreatObjectToNGUI.InstantiateObj(MedicineItemTipsPrefab, transform).GetComponent <ItemInfoTips_Medicine>(); } MedicineItemtips.Show(itemFielInfo); } break; default: break; } }
/// <summary> ///需要展示基础属性的调这个,这个不会考虑物品等级,强化等 /// </summary> /// <param name="ItemID">Item I.</param> public void Show(int ItemID) { SoundManager.Instance.PlaySoundEffect("Sound_Button_Default_Open"); HasClik = false; bool ShowPathLinkBtn = true; // this.MyParent = myParent; //CurrentItem = itemFielInfo; ItemFielInfo itemFielInfo = new ItemFielInfo(ItemID); CurrentItem = itemFielInfo; if (itemFielInfo.LocalItemData == null) { return; } switch (itemFielInfo.LocalItemData._GoodsClass) { case 1: //装备显示 if (EquiptItemTips_normal == null) { EquiptItemTips_normal = CreatObjectToNGUI.InstantiateObj(EquiptItemTipsPrefab, transform).GetComponent <ItemInfoTips_Equipment>(); } EquiptItemTips_normal.Show(itemFielInfo, false, false, ShowPathLinkBtn); break; case 2: if (itemFielInfo.LocalItemData._GoodsSubClass == 4) { //if(GiftPanelItemtips!=null){Destroy(GiftPanelItemtips);} if (GiftPanelItemtips == null) { GiftPanelItemtips = CreatObjectToNGUI.InstantiateObj(GiftItemTipsPrefab, transform).GetComponent <GiftPanel>(); } GiftPanelItemtips.Show(itemFielInfo, true); // GiftPanelItemtips.CallBackOnSellClick = OnButtonClick; GiftPanelItemtips.CallBackOnCloseHandle = Close; } else { if (MedicineItemtips == null) { MedicineItemtips = CreatObjectToNGUI.InstantiateObj(MedicineItemTipsPrefab, transform).GetComponent <ItemInfoTips_Medicine>(); } MedicineItemtips.Show(itemFielInfo.LocalItemData as MedicamentData); } break; case 3: if (itemFielInfo.LocalItemData._GoodsSubClass == 9) { return; } if (itemFielInfo.LocalItemData._GoodsSubClass == 3) { if (EquiptItemTips_Jewel == null) { EquiptItemTips_Jewel = CreatObjectToNGUI.InstantiateObj(JewelItemTipsPrefab, transform).GetComponent <ItemInfoTips_Jewel>(); } EquiptItemTips_Jewel.Show(itemFielInfo.LocalItemData as Jewel, true, true); } else { if (MedicineItemtips == null) { MedicineItemtips = CreatObjectToNGUI.InstantiateObj(MedicineItemTipsPrefab, transform).GetComponent <ItemInfoTips_Medicine>(); } MedicineItemtips.Show(itemFielInfo.LocalItemData); } break; default: return; } // TweenAlpha.Begin(m_PackRightBtnManager.gameObject,0.1f,0,1,null); // TweenPosition.Begin(m_PackRightBtnManager.gameObject,0.1f,m_PackRightBtnManager.transform.localPosition,RightBtnShowPos); transform.localPosition = new Vector3(0, 0, -150); //InitButton(itemFielInfo); m_PackRightBtnManager.gameObject.SetActive(false); }