Class ImageCreator
Class that unifies the methods in order to be able to snapshot any game item out of unity
Inherited Members
Namespace: VISABConnector.Unity
Assembly: VISABConnector.Unity.dll
Syntax
public static class ImageCreator
Fields
| Improve this Doc View SourceVISABLayerName
The VISAB layer variable which is assigned to every game object that will be snapshotted
Declaration
public const string VISABLayerName = "VISAB"
Field Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceInstantiateGameObject(InstantiationConfiguration)
Instantiates a GameObject based on the given configuration and returns the instance.
Declaration
public static GameObject InstantiateGameObject(InstantiationConfiguration config)
Parameters
Type | Name | Description |
---|---|---|
InstantiationConfiguration | config | The configuration based on which the GameObject will be instantiated |
Returns
Type | Description |
---|---|
UnityEngine.GameObject | The instance for the given configuration |
SetLayerRecursively(GameObject, Int32)
Assigns Layer to all children of gameobject
Declaration
public static void SetLayerRecursively(GameObject obj, int layer)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.GameObject | obj | |
Int32 | layer |
TakeSnapshot(SnapshotConfiguration)
The actual method that conducts the snapshotting of game objects. It is calibrated by passing a config object to it
Declaration
public static byte[] TakeSnapshot(SnapshotConfiguration config)
Parameters
Type | Name | Description |
---|---|---|
SnapshotConfiguration | config | The config object that handles the specific requirements for snapping certain game objects |
Returns
Type | Description |
---|---|
Byte[] | A byte array which can be converted to a PNG-file or inserted into a JSON-File |
TakeSnapshots(IEnumerable<SnapshotConfiguration>)
Conduct several snapshots at once
Declaration
public static IDictionary<SnapshotConfiguration, byte[]> TakeSnapshots(IEnumerable<SnapshotConfiguration> configs)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<SnapshotConfiguration> | configs | The config objects you will need for the snapshots |
Returns
Type | Description |
---|---|
IDictionary<SnapshotConfiguration, Byte[]> | A dictionary which contains the byte arrays with their respective configuration objects |