| documentId | 文档标识符。 |
| propertyPath | 属性路径或名称。 |
| value | 属性的值。 |
bool 如果存储操作成功,则返回 True,否则返回 False。
存储文档属性。
// Store a property of a document, like a property of an asset.
using (var view = propertyDatabase.GetView())
{
var stored = view.Store("path/to/my/asset", "m_Color", new Color(1, 0, 1));
if (!stored)
Debug.LogWarning("Property m_Color did not store.");
}
| documentKey | 文档键。 |
| propertyHash | 属性哈希值。 |
| value | 属性的值。 |
bool 如果存储操作成功,则返回 True,否则返回 False。
使用预计算的文档键和属性哈希值存储文档属性。
// Store a property of a document, with the document id and property hash already computed.
using (var view = propertyDatabase.GetView())
{
var documentId = view.CreateDocumentKey("path/to/my/asset");
var propertyHash = view.CreatePropertyHash("m_Size");
var stored = view.Store(documentId, propertyHash, 42);
if (!stored)
Debug.LogWarning("Property m_Size did not store.");
}
| recordKey | 记录键。 |
| value | 属性的值。 |
bool 如果存储操作成功,则返回 True,否则返回 False。
使用预计算的记录键存储文档属性。
// Store a property with an already computed record key.
using (var view = propertyDatabase.GetView())
{
var recordKey = view.CreateRecordKey("path/to/my/asset", "prop1");
var stored = view.Store(recordKey, 123);
if (!stored)
Debug.LogWarning("Property prop1 did not store.");
}
| propertyHash | 属性哈希值。 |
| value | 属性的值。 |
bool 如果存储操作成功,则返回 True,否则返回 False。
使用预计算的属性哈希值存储属性。
文档标识符被视为 null,文档键将为 0。
// Store a property without any document.
using (var view = propertyDatabase.GetView())
{
var stored = view.Store(view.CreatePropertyHash("documentPrefix"), "myDocs_");
if (!stored)
Debug.LogWarning("Property documentPrefix did not store.");
}