Class AdditionalPropertyContainer
glTF object base class
Inherited Members
Namespace: Unity.Cloud.Gltfast.Objects
Assembly: Unity.Cloud.Gltfast.dll
Syntax
public class AdditionalPropertyContainer : IPropertyContainer, IReadOnlyPropertyContainer
Properties
Count
Gets the number of additional properties.
Declaration
[JsonIgnore]
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
Clear()
Removes all properties.
Declaration
public virtual void Clear()
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. |
Remove(string)
Removes the property key.
Declaration
public bool Remove(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The property name. |
Returns
| Type | Description |
|---|---|
| bool |
|
Set<T>(string, T)
Sets the property key to value, serialized to JSON.
Declaration
public virtual void Set<T>(string key, T value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The property name. |
| T | value | The value to store. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the value to serialize. |
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 |