I am trying to create a dropdown with all the files located in a specific path the problem is when I load the files the show in the dropdown with the full path as a name for it how I change this and just keep the file name show in the dropdown? How can I fix it?
void loadedfiles()
{
string[] myload = getfilesname();
}
string[] getfilesname()
{
string folderPath = Path.Combine(Application.persistentDataPath, foldername);
string[] filePaths = Directory.GetFiles(folderPath, "*.txt");
foreach (string file in filePaths)
{
mylist.Add(file);
Debug.Log(file);
}
dropi.AddOptions(mylist);
return filePaths;
}