public static AwardItem AddAward(string awardType, int awardValue) { AwardItem awardItem = new AwardItem(awardType, awardValue); if (PlayerDataPack.IsMoney(awardType)) { PlayerDataPack.Instance.AddMoney(awardType, awardValue); } //gem if (awardType.Equals("20001")) { GemDataPack.Instance.AddRandomGem(1); } else if (awardType.Equals("20002")) { GemDataPack.Instance.AddRandomGem(2); } else if (awardType.Equals("20003")) { GemDataPack.Instance.AddRandomGem(3); } else if (awardType.Equals("20004")) { GemDataPack.Instance.AddRandomGem(4); } return(awardItem); }
private void RefreshOwnCurrency(object sender, Hashtable hash) { if (PlayerDataPack.IsMoney(_ShowOwnCurrency)) { ShowCurrency(_ShowOwnCurrency, PlayerDataPack.Instance.GetMoney(_ShowOwnCurrency)); } }
void OnDisable() { if (PlayerDataPack.IsMoney(_ShowOwnCurrency)) { GameCore.Instance.EventController.UnRegisteEvent(EVENT_TYPE.EVENT_LOGIC_REFRESH_MONEY, RefreshOwnCurrency); } }
public void GetAward(string id, int value) { if (PlayerDataPack.IsMoney(id)) { PlayerDataPack.Instance.AddMoney(id, value); } //gem if (id.Equals("20001")) { GemDataPack.Instance.AddRandomGem(1); } else if (id.Equals("20002")) { GemDataPack.Instance.AddRandomGem(2); } else if (id.Equals("20003")) { GemDataPack.Instance.AddRandomGem(3); } else if (id.Equals("20004")) { GemDataPack.Instance.AddRandomGem(4); } }
public void ShowOwnCurrency(string itemDataID) { if (PlayerDataPack.IsMoney(itemDataID)) { if (!_ShowOwnCurrency.Equals(itemDataID)) { _ShowOwnCurrency = itemDataID; } ShowCurrency(itemDataID, PlayerDataPack.Instance.GetMoney(itemDataID)); GameCore.Instance.EventController.RegisteEvent(EVENT_TYPE.EVENT_LOGIC_REFRESH_MONEY, RefreshOwnCurrency); } else { } }