Unity 6.3
0 онлайн 81 гостей 3 в системе
Вход

IPropertyDatabaseView.Invalidate(in PropertyDatabaseRecordKey)

Параметры

Параметр Описание
recordKey Ключ записи.

Описание

Отменяет действие одной записи свойства, чтобы она больше не могла быть получена.

using (var view = propertyDatabase.GetView())
{
    // Store a property.
    var propertyRecordKey = view.CreateRecordKey("path/to/my/asset", "m_Color");
    view.Store(propertyRecordKey, new Color(1, 0, 1));

    // Invalidate the property.
    view.Invalidate(propertyRecordKey);

    // The invalidated property can no longer be retrieved.
    if (view.TryLoad(propertyRecordKey, out object propertyValue))
        Assert.Fail("TryLoad should have failed to retrieve the record.");
}

Дополнительные ресурсы: ,IPropertyDatabaseView.CreateRecordKey,.

Declaration

public void Invalidate(string documentId);

Параметры

Параметр Описание
documentId Идентификатор документа.

Описание

Отменяет все свойства, сохраненные для всего документа.

using (var view = propertyDatabase.GetView())
{
    // Store multiple properties of a document.
    var document = "path/to/my/asset";
    view.Store(document, "prop1", "value1");
    view.Store(document, "prop2", "value2");

    // Invalidate the entire document.
    view.Invalidate(document);

    // The invalidated document can no longer be retrieved.
    if (view.TryLoad(view.CreateDocumentKey(document), out IEnumerable<object> documentValues))
        Assert.Fail("TryLoad should have failed to retrieve the document values.");
}

Declaration

public void Invalidate(ulong documentKey);

Параметры

Параметр Описание
documentKey Ключ документа.

Описание

Отменяет все свойства, сохраненные для всего документа.

using (var view = propertyDatabase.GetView())
{
    // Store multiple properties of a document.
    var documentKey = view.CreateDocumentKey("path/to/my/asset");
    view.Store(documentKey, view.CreatePropertyHash("prop1"), "value1");
    view.Store(documentKey, view.CreatePropertyHash("prop2"), "value2");

    // Invalidate the entire document by its key.
    view.Invalidate(documentKey);

    // The invalidated document can no longer be retrieved.
    if (view.TryLoad(documentKey, out IEnumerable<object> documentKeyValues))
        Assert.Fail("TryLoad should have failed to retrieve the document values.");
}

Дополнительные ресурсы: ,IPropertyDatabaseView.CreateDocumentKey,.