foxed file path

This commit is contained in:
Chromium 2025-04-28 04:46:57 +01:00
parent dfd4c498e1
commit 422dcc6f5b

View File

@ -70,22 +70,10 @@ public struct ImageData
{
Texture2D texture = this.ToTexture2D();
byte[] data = texture.EncodeToPNG();
string thePath;
if (path.StartsWith("Assets/"))
{
thePath = path.Substring("Assets/".Length);
}
else
{
thePath = path;
}
thePath.Replace("/", "\\");
if (data != null)
{
System.IO.File.WriteAllBytes(Path.Combine(Application.dataPath, thePath), data);
System.IO.File.WriteAllBytes(path, data);
}
}
}