CodeSmile AssetDatabase 1.9
Unity's AssetDatabase in enjoyable, consistent, concise, convenient, comprehensible, safe, documented form.
Loading...
Searching...
No Matches
Asset.Dependency.cs
1// Copyright (C) 2021-2023 Steffen Itterheim
2// Refer to included LICENSE file for terms and conditions.
3
4using System;
5using System.Diagnostics.CodeAnalysis;
6using UnityEditor;
7using UnityEngine;
8
9namespace CodeSmileEditor
10{
11 public sealed partial class Asset
12 {
16 public static class Dependency
17 {
29 public static String[] GetDirect([NotNull] Path path) => AssetDatabase.GetDependencies(path, false);
30
42 public static String[] GetDirect([NotNull] Path[] paths) => AssetDatabase.GetDependencies(Path.ToStrings(paths), false);
43
55 public static String[] GetAll([NotNull] Path path) => AssetDatabase.GetDependencies(path, true);
56
68 public static String[] GetAll([NotNull] Path[] paths) => AssetDatabase.GetDependencies(Path.ToStrings(paths), true);
69
83 public static void Register([NotNull] String globalDependencyName, Hash128 dependencyHash) =>
84 AssetDatabase.RegisterCustomDependency(globalDependencyName, dependencyHash);
85
96 public static UInt32 Unregister([NotNull] String globalDependencyNamePrefix) =>
97 AssetDatabase.UnregisterCustomDependencyPrefixFilter(globalDependencyNamePrefix);
98
110 public static Hash128 GetHash([NotNull] Path path) => AssetDatabase.GetAssetDependencyHash(path);
111
123 public static Hash128 GetHash(GUID guid) => AssetDatabase.GetAssetDependencyHash(guid);
124 }
125 }
126}
static UInt32 Unregister([NotNull] String globalDependencyNamePrefix)
Unregisters one or more custom dependencies with the given prefix (eg 'StartsWith').
static void Register([NotNull] String globalDependencyName, Hash128 dependencyHash)
Registers a custom dependency to be used in conjunction with a custom AssetImporter.
static String[] GetAll([NotNull] Path[] paths)
Returns all (direct and indirect) dependencies of the assets at the given paths. Returns paths to dep...
static Hash128 GetHash([NotNull] Path path)
Returns the dependency value hash for the asset at path.
static String[] GetDirect([NotNull] Path path)
Returns the direct dependencies of the asset at the given path.
static String[] GetAll([NotNull] Path path)
Returns all (direct and indirect) dependencies of the asset at the given path.
static Hash128 GetHash(GUID guid)
Returns the dependency hash for the asset.
static String[] GetDirect([NotNull] Path[] paths)
Returns the direct dependencies of the assets at the given paths.
Groups all dependency related functionality.
static String[] ToStrings([NotNull] IEnumerable< Path > paths)
Converts an IEnumerable collection of Path instances to a string array.
Represents a relative path to an asset file or folder, typically under 'Assets' or 'Packages'.
Definition Asset.Path.cs:25