예제 #1
0
    /// <summary>
    ///	With the user input values, calculates the equations and prints them in the text boxes
    /// </summary>
    public void CalculateNewValues()
    {
        absText.text  = string.Format("The absolute value of {0} is ", value1);
        absText.text += Maths.Absolute(value1).ToString();

        clampText.text  = string.Format("{0} clamped between {1} and {2} is ", value1, value2, value3);
        clampText.text += Maths.Clamp(value1, value2, value3).ToString();

        maxText.text  = string.Format("The greatest of {0} and {1} is ", value1, value2);
        maxText.text += Maths.Max(value1, value2).ToString();

        minText.text  = string.Format("The lesser of {0} and {1} is ", value1, value2);
        minText.text += Maths.Min(value1, value2).ToString();

        circleAreaText.text  = string.Format("The area of a circle with a radius of {0} is ", value1);
        circleAreaText.text += (Maths.Pi * Maths.Squared(value1)).ToString();

        squaredText.text  = string.Format("{0} squared is ", value1, value2);
        squaredText.text += Maths.Squared(value1).ToString();
    }