Answers for "unity round"

C#
4

unity round

Mathf.Round(10.2f);
Posted by: Guest on February-21-2020
0

how to round to nearest whole number unity

// Prints 10
        Debug.Log(Mathf.Round(10.0f));

        // Prints 10
        Debug.Log(Mathf.Round(10.2f));

        // Prints 11
        Debug.Log(Mathf.Round(10.7f));
Posted by: Guest on May-08-2020
3

unity round int

//int
int sayi = 0;
sayi = ((int)(((int)(sayi / 10)) * 10));
//float
float sayi;
sayi = ((float)(((int)(sayi/10))*10));
Posted by: Guest on January-15-2021

C# Answers by Framework

Browse Popular Code Answers by Language