Hi guys,
How can I know the size of this array ?
Resolution[ ] resolutions = Screen.resolutions;
Basically, from this link :
How can I do this for cycle in C# ?
for (var res in resolutions) {
print(res.width + "x" + res.height);
}
thanks,
Bruno
Hi guys,
How can I know the size of this array ?
Resolution[ ] resolutions = Screen.resolutions;
Basically, from this link :
How can I do this for cycle in C# ?
for (var res in resolutions) {
print(res.width + "x" + res.height);
}
thanks,
Bruno
int arrayLength = resolutions.Length;
foreach (Resolution res in resolutions) {
Debug.Log(res.width + "x" + res.height);
}
EDIT: in the upper left corner of that website you linked, there is an option to show code in C#.
oops, you are right…
stupid me ![]()
Native arrays have a “Length” property, so you can use that. So it’ll be something like resolutions.Length.