FloorToInt
How do I use Floor To Int
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
36 | int numberOfDots = Mathf.FloorToInt( Time.timeSinceLevelLoad * 3f % 4 ); | 1 |
173 |
int cellPerFrame = Mathf.FloorToInt(scrollRect.GetComponent |
2 |
File name: ShowStatusWhenConnecting.cs
Copy
33 string GetConnectingDots()
34 {
35 string str = "";
36 int numberOfDots = Mathf.FloorToInt( Time.timeSinceLevelLoad * 3f % 4 );
37
38 for( int i = 0; i < numberOfDots; ++i )
39 {
40 str += " .";
41 }
42
43 return str;
44 }
File name: ScrollSnap.cs
Copy
172 int CalculateMaxIndex() {
173 int cellPerFrame = Mathf.FloorToInt(scrollRect.GetComponent
174 return LayoutElementCount() - cellPerFrame;
175 }
FloorToInt 147 lượt xem
Gõ tìm kiếm nhanh...