Home > OS >  How to see array or list in console tap (Unity)
How to see array or list in console tap (Unity)

Time:07-04

How to see Array or List in console tap?
Is there the way to see them in console tap?
I want Debug.Log(array) -> [1,2,3,4]

CodePudding user response:

for(int i = 0; i < array.Length; i  )
{
    Debug.Log(array[i]);
}

Almost the same for the list. Or if you need a single-line variant

StringBuilder sb = new StringBuilder();
for(int i = 0; i < array.Length; i  )
{
    sb.Append(array[i]);
    sb.Append(" ");
}
Debug.Log(sb.ToString());
  • Related