/// <summary> /// /// </summary> public void SwitchBuyMode() { GUI_Text_SwitchButtonText.text = BuyAmountMode.ToString(); GUI_Button_SwitchBuyAmount.onClick.AddListener(() => { BuyAmountMode current = BuyAmountMode; if (current == Enum.GetValues(typeof(BuyAmountMode)).Cast <BuyAmountMode>().Max()) { BuyAmountMode = BuyAmountMode.Single; } else { BuyAmountMode = current + 1; } switch (BuyAmountMode) { case BuyAmountMode.Single: amount = 1; break; case BuyAmountMode.Fifty: amount = 50; break; case BuyAmountMode.OneHundred: amount = 100; break; } for (int i = 0; i < SaveLoad.Instance.Recipe_Item.Count; i++) { RecipeData r = SaveLoad.Instance.Recipe_Item[i].GetComponent <RecipeData>(); r.AmountSellMuiltplyer = amount; r.UpdateText(); } GUI_Text_SwitchButtonText.text = BuyAmountMode.ToString(); }); }