Version: 2023.1

AssetDatabase.TryGetAssetFolderInfo

切换到手册
public static bool TryGetAssetFolderInfo (string path, out bool rootFolder, out bool immutable);

参数

path A project relative or absolute path to a file or a folder.
rootFolder This value will be set to true if the given path is a root folder in the AssetDatabase.
immutable This value will be true if the given file or folder can't be modified by the AssetDatabase .

返回

bool Returns true if the given path is in a folder managed by the AssetDatabase, false otherwise.

描述

Get AssetDatabase specific information about a folder.

This method can be used to know whether a path is tracked by the AssetDatabase. Being tracked means that files added to this folder will have a .meta file added along them and be imported and available in the current Unity project. The out arguments can be used to get more information about the given path. - rootFolder is true if the given path is the root of a tracked path on your drive. For example the Assets folder is a root. - immutable is true if the given path is under a root folder registered with the immutable flag. For example files in a package added from the package manager registry will be immutable.