본문 바로가기

Programming

파일) Path

string GetFilePath (string _fname) {

 

string _path = "";

 

if (Application.platform == RuntimePlatform.Android) {

_path = Application.persistentDataPath;

_path = _path.Substring (0, _path.LastIndexOf ('/'));

} else if (Application.platform == RuntimePlatform.IPhonePlayer) {

_path = Application.dataPath.Substring (0, Application.dataPath.Length - 5);

_path = _path.Substring (0, _path.LastIndexOf ('/'));

} else {

_path = Application.dataPath;

_path = _path.Substring (0, _path.LastIndexOf ('/'));

}

----

----

return Path.Combine (_path, _fname);

}