Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
System.IO.Path.Combine is not working properly?
Code:
string daytimePath = Path.Combine(Application.dataPath, "/Pictures/Backgrounds/Day");
It should return "C:/Users/[User]/Documents/Unity Projects/_Indie Games/Train Conductor/Assets/Pictures/Background/Day", but instead it returns "C:/Pictures/Background/Day"; that is, it completely negates Application.dataPath. Why?
1 Answer
- husoskiLv 74 years ago
The leading "/" in the second path component makes it root-relative. It will only use the drive portion of the first component and ignore the rest of the path.
Change that to:
string daytimePath = Path.Combine(Application.dataPath, "Pictures/Backgrounds/Day");
...and you'll get better results.