1
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user