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);
    }
Ejemplo n.º 2
0
    void Init()
    {
        LabelInit();

        GetComponent <Toggle>().isOn = PlantSettingPlane.GetInstance().HaveInsects;

        UpdateLabel();
    }
    public static PlantSettingPlane GetInstance()
    {
        if (instance == null)
        {
            instance = GameObject.Find("Canvas").
                       transform.Find("Plant Settings").GetComponent <PlantSettingPlane>();
        }

        return(GameObject.Find("Canvas").
               transform.Find("Plant Settings").GetComponent <PlantSettingPlane>());
    }
    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;
    }
Ejemplo n.º 5
0
    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;
    }
Ejemplo n.º 6
0
    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;
 }
Ejemplo n.º 8
0
 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);
    }
Ejemplo n.º 10
0
 public void ValueChange(int value)
 {
     PlantSettingPlane.GetInstance().WaterContent = MaizeParams.WaterContents[value];
 }
Ejemplo n.º 11
0
 public void ValueChange(bool value)
 {
     PlantSettingPlane.GetInstance().HaveInsects = value;
 }