public bool SetGachaButtonUIParameter(GachaButton.GachaCostType cost_type = GachaButton.GachaCostType.NONE, GachaButton.GachaCategoryType category_type = GachaButton.GachaCategoryType.NONE) { if (cost_type == GachaButton.GachaCostType.NONE || cost_type == GachaButton.GachaCostType.ALL || (category_type == GachaButton.GachaCategoryType.NONE || category_type == GachaButton.GachaCategoryType.ALL)) { return(false); } this.mCostType = cost_type; this.mCategoryType = category_type; this.mUpdateTrigger = true; return(true); }
private bool UpdateOptionObject(GachaButton.GachaCategoryType category = GachaButton.GachaCategoryType.NONE, GachaButton.GachaCostType cost = GachaButton.GachaCostType.NONE) { if (category == GachaButton.GachaCategoryType.NONE || category == GachaButton.GachaCategoryType.ALL || (cost == GachaButton.GachaCostType.NONE || cost == GachaButton.GachaCostType.ALL)) { return(false); } this.optionLayout.SetActive(false); this.optionLayout2.SetActive(false); this.paidOption.SetActive(false); this.timerOption.SetActive(false); this.stepupOption.SetActive(false); if (cost == GachaButton.GachaCostType.COIN_P) { this.optionLayout2.SetActive(true); this.paidOption.SetActive(true); } if (cost == GachaButton.GachaCostType.TICKET) { if (Object.op_Inequality((Object)this.TicketState, (Object)null)) { Text component = (Text)this.TicketState.GetComponent <Text>(); if (Object.op_Inequality((Object)component, (Object)null)) { component.set_text(this.TicketNum.ToString()); this.optionLayout.SetActive(true); } } } else if (category == GachaButton.GachaCategoryType.STEPUP) { if (Object.op_Inequality((Object)this.StepupState, (Object)null)) { if (Object.op_Equality((Object)this.mCurrentStepup10, (Object)null)) { Transform child = this.StepupState.get_transform().FindChild("current_10"); this.mCurrentStepup10 = !Object.op_Inequality((Object)child, (Object)null) ? (GameObject)null : ((Component)child).get_gameObject(); } if (Object.op_Equality((Object)this.mCurrentStepup1, (Object)null)) { Transform child = this.StepupState.get_transform().FindChild("current_1"); this.mCurrentStepup1 = !Object.op_Inequality((Object)child, (Object)null) ? (GameObject)null : ((Component)child).get_gameObject(); } if (Object.op_Equality((Object)this.mMaxStepup10, (Object)null)) { Transform child = this.StepupState.get_transform().FindChild("max_10"); this.mMaxStepup10 = !Object.op_Inequality((Object)child, (Object)null) ? (GameObject)null : ((Component)child).get_gameObject(); } if (Object.op_Equality((Object)this.mMaxStepup1, (Object)null)) { Transform child = this.StepupState.get_transform().FindChild("max_1"); this.mMaxStepup1 = !Object.op_Inequality((Object)child, (Object)null) ? (GameObject)null : ((Component)child).get_gameObject(); } if (Object.op_Equality((Object)this.mCurrentStepup1, (Object)null) || Object.op_Equality((Object)this.mCurrentStepup10, (Object)null) || (Object.op_Equality((Object)this.mMaxStepup1, (Object)null) || Object.op_Equality((Object)this.mMaxStepup10, (Object)null))) { return(false); } int num1 = (this.StepIndex + 1) % 10; int num2 = (this.StepIndex + 1) / 10; int num3 = this.StepMax % 10; int num4 = this.StepMax / 10; ((ImageArray)this.mCurrentStepup1.GetComponent <ImageArray>()).ImageIndex = num1; ((ImageArray)this.mCurrentStepup10.GetComponent <ImageArray>()).ImageIndex = num2; ((ImageArray)this.mMaxStepup10.GetComponent <ImageArray>()).ImageIndex = num4; ((ImageArray)this.mMaxStepup1.GetComponent <ImageArray>()).ImageIndex = num3; this.mCurrentStepup10.SetActive(num2 > 0); this.mMaxStepup10.SetActive(num4 > 0); this.optionLayout.SetActive(true); this.stepupOption.SetActive(true); } } else if ((this.Category == "coin_1" || this.Category == "gold_1") && (Object.op_Inequality((Object)this.TimerObject, (Object)null) && Object.op_Inequality((Object)this.LimitObject, (Object)null))) { bool flag = true; if (this.mCostType == GachaButton.GachaCostType.FREE_COIN || this.mCostType == GachaButton.GachaCostType.COIN) { this.UpdateTimer(this.gm.Player.GetNextFreeGachaCoinCoolDownSec()); this.UpdateLimit(1 - this.gm.Player.FreeGachaCoin.num); flag = this.gm.Player.CheckFreeGachaCoin(); } else if (this.mCostType == GachaButton.GachaCostType.FREE_GOLD || this.mCostType == GachaButton.GachaCostType.GOLD) { this.UpdateTimer(this.gm.Player.GetNextFreeGachaGoldCoolDownSec()); this.UpdateLimit((int)this.gm.MasterParam.FixParam.FreeGachaGoldMax - this.gm.Player.FreeGachaGold.num); flag = this.gm.Player.CheckFreeGachaGold(); } this.TimerObject.SetActive(!flag); this.LimitObject.SetActive(flag); this.optionLayout.SetActive(true); this.timerOption.SetActive(true); } return(true); }