コード例 #1
0
ファイル: ValueDisplay.cs プロジェクト: seanyourchek-dev/repo
    public void showMinMaxValue()
    {
        vs = valueManager.instance.getFirstFittingValue(valueTyp);

        if (vs != null)
        {
            if (maxValueText != null)
            {
                maxValueText.text = (vs.getMaxValue() * displayMultiplier).ToString(formatter);
            }
            if (minValueText != null)
            {
                minValueText.text = (vs.getMinValue() * displayMultiplier).ToString(formatter);
            }
            if (currentValueText != null)
            {
                currentValueText.text = (vs.value * displayMultiplier).ToString(formatter);
            }

            //display to sliders, if available
            if (currentValueSlider != null)
            {
                currentValueSlider.maxValue = vs.limits.max;
                currentValueSlider.value    = vs.value;
            }
            if (minValueSlider != null)
            {
                minValueSlider.maxValue = vs.limits.max;
                minValueSlider.value    = vs.getMinValue();
            }
            if (maxValueSlider != null)
            {
                maxValueSlider.maxValue = vs.limits.max;
                maxValueSlider.value    = vs.getMaxValue();
            }

            //display to imagefill, if available
            if (currentValueImage != null)
            {
                float percentage = vs.value / vs.limits.max;
                currentValueImage.fillAmount = percentage;
            }
            if (minValueImage != null)
            {
                float percentage = vs.getMinValue() / vs.limits.max;
                minValueImage.fillAmount = percentage;
            }
            if (maxValueImage != null)
            {
                float percentage = vs.getMaxValue() / vs.limits.max;
                maxValueImage.fillAmount = percentage;
            }
        }
    }
コード例 #2
0
    public void showMinMaxValue()
    {
        vs = valueManager.instance.getFirstFittingValue(valueTyp);

        if (vs != null)
        {
            if (maxValueText != null)
            {
                maxValueText.text = (vs.getMaxValue() * displayMultiplier).ToString(formatter);
            }
            if (minValueText != null)
            {
                minValueText.text = (vs.getMinValue() * displayMultiplier).ToString(formatter);
            }
            if (currentValueText != null)
            {
                currentValueText.text = (vs.value * displayMultiplier).ToString(formatter);
            }
        }
    }