Class Metadata
When attached to a GameObject (as a Component), the Metadata will store and display all metadata properties.
Those properties can be automatically imported from the Importer (with the correct settings).
Inheritance
Namespace: PiXYZ.Import
Assembly: cs.temp.dll.dll
Syntax
public sealed class Metadata : MonoBehaviour
Examples
Metadata metadata = gameObject.GetComponent<Metadata>()
string partNumber = metadata.getProperty("Part Number");
Fields
type
Declaration
public string type
Field Value
Type | Description |
---|---|
System.String |
Properties
isInstance
Declaration
public bool isInstance { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
addOrSetProperty(String, String)
Adds or set an existing property value. This is case sensitive.
Declaration
public void addOrSetProperty(string propertyName, string propertyValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property to look for |
System.String | propertyValue | Value of the property to add or set |
containsProperty(String)
Returns true if the metadata contains a property with the given name. This is case sensitive.
Declaration
public bool containsProperty(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property to look for |
Returns
Type | Description |
---|---|
System.Boolean | True if the property exists |
getProperties()
Returns the properties as a Dictionary.
Declaration
public Dictionary<string, string> getProperties()
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | A Dictionary with all properties |
getPropertiesNative()
Returns native properties
Declaration
public NativeInterface.Properties getPropertiesNative()
Returns
Type | Description |
---|---|
PiXYZ.Plugin4Unity.NativeInterface.Properties | Native properties |
getProperty(String)
Returns a property value from its name. This will produce an exception if no property exists with the given name. This is case sensitive.
Declaration
public string getProperty(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property to look for |
Returns
Type | Description |
---|---|
System.String | The property value (string) |
removeProperty(String)
Removes a property. Returns true if the operation was successful. This is case sensitive.
Declaration
public bool removeProperty(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property to look for |
Returns
Type | Description |
---|---|
System.Boolean | True if the property was removed. False if the property doesn't exists. |
setProperties(NativeInterface.Properties)
Sets the properties from Native Interface.
Declaration
public void setProperties(NativeInterface.Properties properties)
Parameters
Type | Name | Description |
---|---|---|
PiXYZ.Plugin4Unity.NativeInterface.Properties | properties | Native properties |