- Home /
how to convert absolute path to relative Application.DataPath
GetFiles function returns this path:
E:/Users/Tuone/Downloads/CharacterCustomization/CharacterCustomization/Assets\DressingroomExample\dressing_room\textures\floor_wood.tga
how do i convert it to the relative Application.DataPath, i.e. from Assets word onwards?
Comment
Best Answer
Answer by frogsbo · Sep 08, 2014 at 06:54 PM
if (absolutepath.StartsWith(Application.dataPath)) {
relativepath= "Assets" + absolutepath.Substring(Application.dataPath.Length);
}
This is amazing, man. Thank you very much for the answer. I appreciate.
Your answer
Follow this Question
Related Questions
Relative asset paths 1 Answer
Specifying a game object by height or width or length instead of localScale 1 Answer
Is it possible to open a web page inside Unity? 2 Answers
Relative and absolute values problem 2 Answers
AssetDatabase current folder? 2 Answers