UnityEditor.PackageImport.IsAllFilePathsValid C# (CSharp) Method

IsAllFilePathsValid() private static method

private static IsAllFilePathsValid ( AssetsItem assetItems, string &errorMessage ) : bool
assetItems AssetsItem
errorMessage string
return bool
        private static bool IsAllFilePathsValid(AssetsItem[] assetItems, out string errorMessage)
        {
            foreach (AssetsItem item in assetItems)
            {
                char ch;
                int num2;
                if ((item.assetIsDir != 1) && HasInvalidCharInFilePath(item.pathName, out ch, out num2))
                {
                    errorMessage = string.Format("Invalid character found in file path: '{0}'. Invalid ascii value: {1} (at character index {2}).", item.pathName, (int) ch, num2);
                    return false;
                }
            }
            errorMessage = string.Empty;
            return true;
        }

Usage Example

示例#1
0
        private static bool ValidateInput(ImportPackageItem[] items)
        {
            string errorMessage;

            if (!PackageImport.IsAllFilePathsValid(items, out errorMessage))
            {
                return(EditorUtility.DisplayDialog("Invalid file path found", errorMessage + "\nDo you want to import the valid file paths of the package or cancel importing?", "Import", "Cancel importing"));
            }
            return(true);
        }
All Usage Examples Of UnityEditor.PackageImport::IsAllFilePathsValid