How to get project path in Unity3d

Some little code snippets to get filepaths in different situations

If you need a file path to specific asset you can use AssetDatabase class:

AssetDatabase.GetAssetOrScenePath(yourAsset);

If you need a file path to your project’s root path, you can use this:

System.IO.Directory.GetCurrentDirectory()

*this works in Editor scripts, such as your Editor Windows, or menus.

Понравилась статья? Поделиться с друзьями:
Автор snezhok_13
Пишет статьи о разработке игр. Не инди, — работает рендеринг-программистом в крупной ААА студии в Санкт-Петербурге. Большой поклонник игр Naughty Dog.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *