AssetDatabase.UnregisterCustomDependencyPrefixFilter

Unity · Версия 2020.3 LTS · Scripting · AssetDatabase

AssetDatabase.UnregisterCustomDependencyPrefixFilter

Объявление

public static uint UnregisterCustomDependencyPrefixFilter(string prefixFilter);

Параметры

prefixFilter Фильтр префиксов для отмены регистрации пользовательских зависимостей.

Возвращает

uint Количество удаленных пользовательских зависимостей.

Описание

Удаляет пользовательские зависимости, соответствующие prefixFilter.

using UnityEngine;
using UnityEditor;
using UnityEngine.Assertions;
public class CustomDependenciesExample
{
    public static void AddAndRemoveCustomDependencies()
    {
        // Example to to illustrate how UnregisterCustomDependencyPrefixFilter works. Not a useful scenario.
        AssetDatabase.RegisterCustomDependency("MyDependencySystem/DepA", Hash128.Compute("Hello"));
        AssetDatabase.RegisterCustomDependency("MyDependencySystem/DepB", Hash128.Compute("World"));

        var unregistered = AssetDatabase.UnregisterCustomDependencyPrefixFilter("MyDependencySystem/");
        Assert.AreEqual(2, unregistered);
    }
}

Обновлено 17 ноября 2026 г.