void PurchaseFunction() { if (attribute.number == 0) { return; } //购买 int money = attribute.money * attribute.number; if (SaveSprite.Model.money < money) { PanelManager.Instantiate.ErrorPanel.Open("钱不够"); return; } SaveSprite.AddMoney(money * -1); SaveSprite.AddProp(attribute, CurrentNumber); PanelManager.Instantiate.BackPack.OnUpdate(); }
void ReturnFunction() { //放回 if (SaveSprite.BackPackIsNull(1) == false) { return; } for (int i = 0; i < character.prop.Length; i++) { if (character.prop[i].id == attribute.id) { if (SaveSprite.AddProp(attribute, CurrentNumber)) { character.prop[i].SetNull(); } else { PanelManager.Instantiate.ErrorPanel.Open("full"); } break; } } }