protected override void OnDropdownClick(Dropdown dpd) { base.OnDropdownClick(dpd); switch (dpd.name) { case "PatternDropdown": case "OperandDropdown": break; case "AmountDropdown": curAmountID = (AmountID)dpd.value; break; case "SymbolDropdown": curSymbolID = (SymbolID)dpd.value; RefreshDigitDropdown(dpd.value); break; case "DigitDropdown": curDigitID = (DigitID)(dpd.value + delta); break; default: MyDebug.LogYellow("Can not find Dropdown: " + dpd.name); break; } }
/// <summary> /// 是否满足除法条件 /// </summary> /// <param name="instance"></param> /// <param name="min"></param> /// <param name="max"></param> /// <returns></returns> private bool CanDevide(List <int> instance, DigitID digitID, out int product) { product = 1; int max = (int)Mathf.Pow(10, (int)digitID + 1); for (int i = 0; i < instance.Count; i++) { product *= instance[i]; } return(product > max && product < max * 10); }
/// <summary> /// 刷新Dropdown的状态 /// </summary> private void RefreshCategoryContent() { Dropdown[] dropdownArray = GetComponentsInChildren <Dropdown>(true); for (int i = 0; i < dropdownArray.Length; i++) { for (int j = 0; j < dropdownArray[i].options.Count; j++) { dropdownArray[i].options[j].text = LanguageController.Instance.GetLanguage(dropdownArray[i].options[j].text); } dropdownArray[i].value = 0; dropdownArray[i].RefreshShownValue(); } RefreshDigitDropdown(0); curAmountID = 0; curSymbolID = 0; curDigitID = 0; }
public CategoryInstance(PatternID patternID, AmountID amountID, SymbolID symbolID, DigitID digitID, OperandID operandID) { this.patternID = patternID; this.amountID = amountID; this.symbolID = symbolID; this.digitID = digitID; this.operandID = operandID; }