mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 00:30:12 +08:00
[unity] Better GetPathSafeName
This commit is contained in:
parent
7e910cb8f7
commit
aea15e63d8
@ -1554,12 +1554,11 @@ namespace Spine.Unity.Editor {
|
||||
}
|
||||
#endregion
|
||||
|
||||
//public static string GetPathSafeRegionName (AtlasRegion region) {
|
||||
// return region.name.Replace("/", "_");
|
||||
//}
|
||||
|
||||
public static string GetPathSafeName (string name) {
|
||||
return name.Replace("/", "_");
|
||||
foreach (char c in System.IO.Path.GetInvalidFileNameChars()) { // Doesn't handle more obscure file name limitations.
|
||||
name = name.Replace(c, '_');
|
||||
}
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user