Add digit check at asset creation.

This commit is contained in:
Jean-Baptiste Perrier
2021-05-10 18:20:58 +02:00
parent 2c51f79c0a
commit 0a32e6bf7d

View File

@@ -118,6 +118,13 @@ namespace FlaxEditor.Modules
return false;
}
// Scripts cannot start with digit.
if (Char.IsDigit(shortName[0]))
{
hint = "Name cannot start with a digit.";
return false;
}
// Cache data
string sourcePath = item.Path;
string sourceFolder = System.IO.Path.GetDirectoryName(sourcePath);