Skip to main content

SymlinkUtility

Important Attention Reminder

Coding Style wiki


SymlinkUtility provides menu items for creating folder symlinks in the project. Link shared folders outside the project into it via Junction / Absolute Symlink / Relative Symlink (e.g. shared art assets or cross-project shared modules), with a <=> marker drawn next to symlinked folders in the Project window (modified from karl-/unity-symlink-utility).

NamespaceOxGKit.Utilities.Symlink.Editor
Typepublic static class SymlinkUtility
SourceSymlinkUtility.cs

Use them from the Project window Right-Click (or the Assets menu): a folder panel opens to pick the source folder, and the link is created under the currently selected folder (Assets when nothing is selected):

MenuDescription
Assets/Create/Folder (Junction)Creates a Junction link (Windows only, no administrator privileges required).
Assets/Create/Folder (Absolute Symlink)Creates an absolute-path symbolic link.
Assets/Create/Folder (Relative Symlink)Creates a relative-path symbolic link.

Attention On Windows, creating a Symlink (Absolute / Relative) requires administrator privileges (a UAC prompt appears), while Junction does not; on macOS the link is created via ln -s.

General Rules

Constraints

  • The source folder must not be inside this project (under Application.dataPath); otherwise a warning is logged and the operation aborts.
  • The operation aborts when a folder with the same name already exists at the target location.
  • AssetDatabase.Refresh runs automatically after the link is created.
  • In the Project window, symlinked folders (including Junctions) show a <=> marker on the right for easy identification.

Reminder Assets inside symlinked folders are imported by Unity as project assets; when collaborating, make sure every team member has the source folder on their machine, and mind how your VCS handles symlinks.