public TableDailySign Get(int id) { TableDailySign data = null; _ins.mDict.TryGetValue(id, out data); return(data); }
public void DailySign(float multiple) { if (!CanDailySign()) { DispatchEvent(EventGameData.Action.Error, LTKey.DAILY_SIGN_CANT_SIGN); return; } var days = localData.signDays; localData.signDays = (days % 7) + 1; localData.lastSignDateTicks = DateTime.Now.Date.Ticks; var t = TableDailySign.Get(days); if (t.type == 1) { AddDiamondWithEffect(t.count); } else if (t.type == 2) { AddCoin(t.count * multiple * FormulaUtil.Expresso(CT.table.formulaArgsDailySignCoin)); } SaveLocalData(); DispatchEvent(EventGameData.Action.DataChange); Analytics.Event.DailySign(days, multiple); }
public void SetData(int days) { var t = TableDailySign.Get(days); title.text = LT.Get(t.nameID); image.SetSprite(t.icon); if (t.type == 2) // coin { count.text = "x" + t.count * FormulaUtil.Expresso(CT.table.formulaArgsDailySignCoin); } else { count.text = "x" + t.count; } if (days == D.I.signDays) { if (D.I.CanDailySign()) { stateRadio.Radio(1); } else { stateRadio.Radio(0); } } else { if (days < D.I.signDays) { stateRadio.Radio(2); } else { stateRadio.Radio(0); } } bgRadio.Radio(stateRadio.index); btn.clickEventID = days; }