This commit is contained in:
MuHua-123
2025-11-17 11:56:36 +08:00
parent 7bc98d9fe6
commit 3f4d3220b1
2 changed files with 54 additions and 20 deletions
@@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
namespace MuHua {
@@ -26,5 +27,11 @@ namespace MuHua {
public static FileName Create(string name, string directory, string extensions) {
return new FileName() { name = name, directory = directory, extensions = extensions };
}
public static FileName Parse(string path) {
string name = Path.GetFileNameWithoutExtension(path);
string directory = Path.GetDirectoryName(path);
string extensions = Path.GetExtension(path);
return new FileName() { name = name, directory = directory, extensions = extensions };
}
}
}