I am trying to iterate through a directory that contains a number of save game files to list them all. According to some posts I saw around here, I tried this in C#
using UnityEngine;
using System.Collections;
using System.IO;
DirectoryInfo dir = new DirectoryInfo( path );
FileInfo[] info = dir.GetFiles( "*.xml" );
foreach ( FileInfo f in info )
{
print ( "Found: " + f.Name );
}
It is not working, however, and generates the following compiler error
Does anyone know what I’m doing wrong here?