CodeSmile AssetDatabase 1.9
Unity's AssetDatabase in enjoyable, consistent, concise, convenient, comprehensible, safe, documented form.
Loading...
Searching...
No Matches

◆ Path() [1/3]

Path ( [NotNull] String fullOrRelativePath)

Creates an asset path from either an absolute or relative path.

When passing an absolute path, it is required that the absolute path starts with the project's root folder. This safeguards against accidentally using an absolute path from a different project.

A path can also point to other locations in the project root folder where assets may be stored. The allowed subfolders (case insensitive) are:

  • Assets
  • Library
  • Logs
  • Packages
  • ProjectSettings
  • Temp
  • UserSettings

Example input path:

C:\Users\Urso Clever\Untiy Porjects\Firts Projcet\Assets\something\file.asset

Results in:

Assets/something/file.asset
Parameters
fullOrRelativePathRelative or absolute path to an asset file or folder.
See also

Definition at line 223 of file Asset.Path.cs.

224 {
225 ThrowIf.NullOrWhitespace(fullOrRelativePath, nameof(fullOrRelativePath));
226 m_RelativePath = ToRelative(fullOrRelativePath.ToForwardSlashes());
227 }