//void ResetBtnStatus(INotifyArgs inotifyArgs) //{ // SmsgActionColdWork smsgActionColdWork = (SmsgActionColdWork)inotifyArgs; // if (smsgActionColdWork.sMsgActionColdWorkHead_SC.lMasterID == PlayerManager.Instance.FindHeroDataModel().SMsg_Header.uidEntity) // { // foreach (SMsgActionColdWork_SC child in smsgActionColdWork.sMsgActionColdWork_SCs) // { // //Debug.LogWarning("收到冷却消息:" + child.byClassID); // if (child.byClassID == 1) // { // ColdItem((int)child.dwColdID,(int)child.dwColdTime/1000); // } // } // } //} void ColdItem(int ItemID, int ColdTime) { //print("收到药品使用冷却应答"); var buffID = EctypeManager.Instance.GetCurrentEctypeData().MedicamentBuffIDs.FirstOrDefault( p => p.ColdID == ItemID); if (buffID != null) { medicine.SetMyButtonActive(false); medicine.RecoverMyself(ColdTime); } // if (MedicineButtonItemFielInfo!=null&&ItemID == MedicineButtonItemFielInfo.LocalItemData._goodID) // { // //int ItemNumber = UI.MainUI.ContainerInfomanager.Instance.GetItemNumber(MedicineButtonItemFielInfo.LocalItemData._goodID); // int ItemNumber = MedicineButtonItemFielInfo.sSyncContainerGoods_SC.byNum; // //int ItemNumber = // if (ItemNumber > 99) { ItemNumber = 99; } // if (ItemNumber < 1||!UI.MainUI.ContainerInfomanager.Instance.itemFielArrayInfo.Contains(MedicineButtonItemFielInfo)) // { // SetButtonStatus(null,medicine); // medicine = null; // return; // } // medicine.SetMyButtonActive(false); // medicine.SetButtonText(ItemNumber.ToString()); // medicine.RecoverMyself(ColdTime); // } }
void ColdItem(int ItemID, int ColdTime) { //print("收到药品使用冷却应答"); if (MagicButtonItemFielInfo != null && ItemID == MagicButtonItemFielInfo.LocalItemData._goodID) { int ItemNumber = UI.MainUI.ContainerInfomanager.Instance.GetItemNumber(MagicButtonItemFielInfo.LocalItemData._goodID); if (ItemNumber > 99) { ItemNumber = 99; } if (ItemNumber < 1) { SetButtonStatus(null, MagicButton); MagicButton = null; return; } MagicButton.SetButtonText(ItemNumber.ToString()); MagicButton.RecoverMyself(ColdTime); } else if (HealthButtonItemFielInfo != null && ItemID == HealthButtonItemFielInfo.LocalItemData._goodID) { int ItemNumber = UI.MainUI.ContainerInfomanager.Instance.GetItemNumber(HealthButtonItemFielInfo.LocalItemData._goodID); if (ItemNumber > 99) { ItemNumber = 99; } if (ItemNumber < 1) { SetButtonStatus(null, HealthButton); HealthButton = null; return; } HealthButton.SetButtonText(ItemNumber.ToString()); HealthButton.RecoverMyself(ColdTime); } //SetMyButtons(); }