Struct ReadOnlyProperties
Allocation-free view into additional properties of a glTF JSON object.
Inherited Members
Namespace: Unity.Cloud.Gltfast.Objects
Assembly: Unity.Cloud.Gltfast.dll
Syntax
public readonly ref struct ReadOnlyProperties
Remarks
Mirrors IReadOnlyPropertyContainer, but ref structs cannot implement interfaces in current C# versions older than 13
Properties
Count
Gets the number of additional properties.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
this[string]
Gets the JSON Value for key.
Declaration
public Value this[string key] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The property name. |
Property Value
| Type | Description |
|---|---|
| Value | The property's value. |
Keys
Gets an IEnumerable<T> containing the names of all properties.
Declaration
[JsonIgnore]
public IEnumerable<string> Keys { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
Methods
ContainsKey(string)
Determines whether the IPropertyContainer contains a property with the specified key.
Declaration
public bool ContainsKey(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to locate in the IPropertyContainer |
Returns
| Type | Description |
|---|---|
| bool | true if the IReadOnlyPropertyContainer contains a property with the key; otherwise, false. |
GetEnumerator()
Returns an enumerator over the properties.
Declaration
public PropertyEnumerator GetEnumerator()
Returns
| Type | Description |
|---|---|
| PropertyEnumerator | An enumerator yielding each Property. |
TryGetValue<T>(string, out T)
Tries to find a property of a key
and deserializes its value to type T.
Declaration
public bool TryGetValue<T>(string key, out T value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | Property key |
| T | value | Resulting value |
Returns
| Type | Description |
|---|---|
| bool | True if the property was found and successfully cast to type T. False otherwise. This includes target types that cannot be deserialized at all, like delegates or interfaces. |
Type Parameters
| Name | Description |
|---|---|
| T | Desired target type |