void Init() { LabelsInit(); PlantSettingPlane plane = PlantSettingPlane.GetInstance(); int value = 20; switch (type) { case SliderType.MAX_TEMPERATURE: value = plane.DailyMaxTemperature; break; case SliderType.MIN_TEMPERATURE: value = plane.DailyMinTemperature; break; case SliderType.MAX_RELATIVE_HUMIDITY: value = plane.DailyMaxRelativeHumidity; break; case SliderType.MIN_RELATIVE_HUMIDITY: value = plane.DailyMinRelativeHumidity; break; } SetLabel(); GetComponent <Slider>().value = value; SetNumberLabel(value); }
void Init() { LabelInit(); GetComponent <Toggle>().isOn = PlantSettingPlane.GetInstance().HaveInsects; UpdateLabel(); }
void Init() { LabelInit(); UpdateLabel(); UpdateOptions(); int value = (int)PlantSettingPlane.GetInstance().PhotosyntheticModel; GetComponent <Dropdown>().value = value; transform.Find("Label").GetComponent <Text>().text = GetComponent <Dropdown>().options[value].text; }
void Init() { LabelInit(); UpdateLabel(); UpdateOptions(); int value = MaizeParams.WaterContents.IndexOf(PlantSettingPlane.GetInstance().WaterContent); GetComponent <Dropdown>().value = value; //为保证显示的语言正确,需要重新设定Label transform.Find("Label").GetComponent <Text>().text = GetComponent <Dropdown>().options[value].text; }
void Init() { LabelInit(); UpdateLabel(); UpdateOptions(); int value = (int)PlantSettingPlane.GetInstance().NutrientType; GetComponent <Dropdown>().value = value; //为保证显示的语言正确,需要重新设定Label transform.Find("Label").GetComponent <Text>().text = GetComponent <Dropdown>().options[value].text; }
public void ValueChange(int value) { PlantSettingPlane.GetInstance().PhotosyntheticModel = (PhotosyntheticModels)value; }
public void ValueChange(int value) { PlantSettingPlane.GetInstance().NutrientType = (LightResponseType)value; }
public void SliderValue(float value) { PlantSettingPlane plane = PlantSettingPlane.GetInstance(); Slider slider = GetComponent <Slider>(); switch (type) { case SliderType.MAX_TEMPERATURE: if (value >= plane.DailyMinTemperature) { plane.DailyMaxTemperature = (int)value; } else { slider.value = plane.DailyMinTemperature; } break; case SliderType.MIN_TEMPERATURE: if (value <= plane.DailyMaxTemperature) { plane.DailyMinTemperature = (int)value; } else { slider.value = plane.DailyMaxTemperature; } break; case SliderType.MAX_RELATIVE_HUMIDITY: if (value >= plane.DailyMinRelativeHumidity) { plane.DailyMaxRelativeHumidity = (int)value; } else { slider.value = plane.DailyMinRelativeHumidity; } break; case SliderType.MIN_RELATIVE_HUMIDITY: if (value <= plane.DailyMaxRelativeHumidity) { plane.DailyMinRelativeHumidity = (int)value; } else { slider.value = plane.DailyMaxRelativeHumidity; } break; } SetNumberLabel((int)slider.value); }
public void ValueChange(int value) { PlantSettingPlane.GetInstance().WaterContent = MaizeParams.WaterContents[value]; }
public void ValueChange(bool value) { PlantSettingPlane.GetInstance().HaveInsects = value; }