Depiction Engine For Unity 2023.0 (Alpha)
Loading...
Searching...
No Matches
DepictionEngine.InstanceUtility Class Reference

Utility methods to help with the creation of instances. More...

Static Public Member Functions

static Camera CreateTargetCamera (SerializableGuid parentId, string name="Camera", double distance=1000.0d, string skyboxMaterialPath=RenderingManager.MATERIAL_BASE_PATH+"Skybox/Star-Skybox", InitializationContext initializingContext=InitializationContext.Programmatically, bool setParentAndAlign=false, bool moveToView=false)
 Create a new DepictionEngine.Camera equipped with a DepictionEngine.CameraController and target.
 
static Camera CreateTargetCamera (Transform parent, string name="Camera", double distance=1000.0d, string skyboxMaterialPath=RenderingManager.MATERIAL_BASE_PATH+"Skybox/Star-Skybox", InitializationContext initializingContext=InitializationContext.Programmatically, bool setParentAndAlign=false, bool moveToView=false)
 Create a new DepictionEngine.Camera equipped with a DepictionEngine.CameraController and target.
 
static Planet CreatePlanet (SerializableGuid parentId, string name, bool spherical, double size, double mass, JSONObject json=null, InitializationContext initializingContext=InitializationContext.Programmatically, bool setParentAndAlign=false, bool moveToView=false)
 Create a new planet.
 
static Planet CreatePlanet (Transform parent, string name, bool spherical, double size, double mass, JSONObject json=null, InitializationContext initializingContext=InitializationContext.Programmatically, bool setParentAndAlign=false, bool moveToView=false)
 Create a new planet.
 
static DatasourceRoot CreateLayer (SerializableGuid planetId, string name, JSONObject json=null, InitializationContext initializingContext=InitializationContext.Programmatically)
 Create a new DepictionEngine.DatasourceRoot.
 
static DatasourceRoot CreateLayer (Planet planet, string name, JSONObject json=null, InitializationContext initializingContext=InitializationContext.Programmatically)
 Create a new DepictionEngine.DatasourceRoot.
 
static JSONArray GetLoaderJson (Type loaderType, Type fallbackType)
 Creates a DepictionEngine.JSONArray containing the initialization values for a DepictionEngine.LoaderBase, DepictionEngine.FallbackValues and corresponding DepictionEngine.AssetReference that can be passed on to the json parameter of DepictionEngine.InstanceManager.Initialize or some other instancing derivative methods.
 
static JSONObject GetComponentJson (Type type, SerializableGuid id=default)
 Creates a DepictionEngine.JSONObject of specified type so it can be passed on to the json parameter of DepictionEngine.InstanceManager.Initialize or some other instancing derivative methods.
 
static JSONNode MergeComponentsToObjectInitializationJson (JSONNode componentsJson, JSONObject objectInitializationJson)
 Merge the componentsJson into the objectInitializationJson so it can be passed on to the json parameter of DepictionEngine.InstanceManager.Initialize or some other instancing derivative methods.
 

Detailed Description

Utility methods to help with the creation of instances.

Member Function Documentation

◆ CreateLayer() [1/2]

static DatasourceRoot DepictionEngine.InstanceUtility.CreateLayer ( Planet  planet,
string  name,
JSONObject  json = null,
InitializationContext  initializingContext = InitializationContext::Programmatically 
)
static

Create a new DepictionEngine.DatasourceRoot.

Parameters
planetThe parent DepictionEngine.Planet under which we will create the DepictionEngine.DatasourceRoot.
nameThe name of the layer.
jsonOptional initialization values.
initializingContext.
Returns
The newly created DepictionEngine.DatasourceRoot instance.

◆ CreateLayer() [2/2]

static DatasourceRoot DepictionEngine.InstanceUtility.CreateLayer ( SerializableGuid  planetId,
string  name,
JSONObject  json = null,
InitializationContext  initializingContext = InitializationContext::Programmatically 
)
static

Create a new DepictionEngine.DatasourceRoot.

Parameters
planetIdThe id of the parent DepictionEngine.Planet under which we will create the DepictionEngine.DatasourceRoot.
nameThe name of the layer.
jsonOptional initialization values.
initializingContext.
Returns
The newly created DepictionEngine.DatasourceRoot instance.

◆ CreatePlanet() [1/2]

static Planet DepictionEngine.InstanceUtility.CreatePlanet ( SerializableGuid  parentId,
string  name,
bool  spherical,
double  size,
double  mass,
JSONObject  json = null,
InitializationContext  initializingContext = InitializationContext::Programmatically,
bool  setParentAndAlign = false,
bool  moveToView = false 
)
static

Create a new planet.

Parameters
parentIdThe id of the parent UnityEngine.Transform under which we will create the DepictionEngine.Planet.
nameThe name of the planet.
sphericalDisplay as a sphere (true) or flat (false)?
sizeThe size (radius in spherical mode or width in flat mode), in world units.
massUsed to determine the amount of gravitational force to apply when DepictionEngine.Object.useGravity is enabled.
jsonOptional initialization values.
initializingContext
setParentAndAlignSets the parent and gives the child the same layer and position (Editor Only).
moveToViewInstantiates the GameObject at the scene pivot (Editor Only).
Returns
The newly created DepictionEngine.Planet instance.

◆ CreatePlanet() [2/2]

static Planet DepictionEngine.InstanceUtility.CreatePlanet ( Transform  parent,
string  name,
bool  spherical,
double  size,
double  mass,
JSONObject  json = null,
InitializationContext  initializingContext = InitializationContext::Programmatically,
bool  setParentAndAlign = false,
bool  moveToView = false 
)
static

Create a new planet.

Parameters
parentThe parent UnityEngine.Transform under which we will create the DepictionEngine.Planet.
nameThe name of the planet.
sphericalDisplay as a sphere (true) or flat (false)?
sizeThe size (radius in spherical mode or width in flat mode), in world units.
massUsed to determine the amount of gravitational force to apply when DepictionEngine.Object.useGravity is enabled.
jsonOptional initialization values.
initializingContext
setParentAndAlignSets the parent and gives the child the same layer and position (Editor Only).
moveToViewInstantiates the GameObject at the scene pivot (Editor Only).
Returns
The newly created DepictionEngine.Planet instance.

◆ CreateTargetCamera() [1/2]

static Camera DepictionEngine.InstanceUtility.CreateTargetCamera ( SerializableGuid  parentId,
string  name = "Camera",
double  distance = 1000::0d,
string  skyboxMaterialPath = RenderingManager::MATERIAL_BASE_PATH + "Skybox/Star-Skybox",
InitializationContext  initializingContext = InitializationContext::Programmatically,
bool  setParentAndAlign = false,
bool  moveToView = false 
)
static

Create a new DepictionEngine.Camera equipped with a DepictionEngine.CameraController and target.

Parameters
parentIdThe parent DepictionEngine.SerializableGuid under which we will create the DepictionEngine.Camera.
initializingContext
setParentAndAlignSets the parent and gives the child the same layer and position (Editor Only).
moveToViewInstantiates the GameObject at the scene pivot (Editor Only).
Returns
The newly created DepictionEngine.Camera instance.

◆ CreateTargetCamera() [2/2]

static Camera DepictionEngine.InstanceUtility.CreateTargetCamera ( Transform  parent,
string  name = "Camera",
double  distance = 1000::0d,
string  skyboxMaterialPath = RenderingManager::MATERIAL_BASE_PATH + "Skybox/Star-Skybox",
InitializationContext  initializingContext = InitializationContext::Programmatically,
bool  setParentAndAlign = false,
bool  moveToView = false 
)
static

Create a new DepictionEngine.Camera equipped with a DepictionEngine.CameraController and target.

Parameters
parentThe parent UnityEngine.Transform under which we will create the DepictionEngine.Camera.
initializingContext
setParentAndAlignSets the parent and gives the child the same layer and position (Editor Only).
moveToViewInstantiates the GameObject at the scene pivot (Editor Only).
Returns
The newly created DepictionEngine.Camera instance.

◆ GetComponentJson()

static JSONObject DepictionEngine.InstanceUtility.GetComponentJson ( Type  type,
SerializableGuid  id = default 
)
static

Creates a DepictionEngine.JSONObject of specified type so it can be passed on to the json parameter of DepictionEngine.InstanceManager.Initialize or some other instancing derivative methods.

Parameters
typeThe component type.
idAn Optional component id. If omitted a new guid will be generated.
Returns
The newly create DepictionEngine.JSONObject containing the component initialization values.

◆ GetLoaderJson()

static JSONArray DepictionEngine.InstanceUtility.GetLoaderJson ( Type  loaderType,
Type  fallbackType 
)
static

Creates a DepictionEngine.JSONArray containing the initialization values for a DepictionEngine.LoaderBase, DepictionEngine.FallbackValues and corresponding DepictionEngine.AssetReference that can be passed on to the json parameter of DepictionEngine.InstanceManager.Initialize or some other instancing derivative methods.

Parameters
loaderTypeThe DepictionEngine.LoaderBase type.
fallbackTypeThe DepictionEngine.FallbackValues type.
Returns
The newly created DepictionEngine.JSONArray containing the components initialization values.

◆ MergeComponentsToObjectInitializationJson()

static JSONNode DepictionEngine.InstanceUtility.MergeComponentsToObjectInitializationJson ( JSONNode  componentsJson,
JSONObject  objectInitializationJson 
)
static

Merge the componentsJson into the objectInitializationJson so it can be passed on to the json parameter of DepictionEngine.InstanceManager.Initialize or some other instancing derivative methods.

Parameters
componentsJsonA DepictionEngine.JSONObject or DepictionEngine.JSONArray composed of component(s) initialization values.
objectInitializationJsonThe json to merge the component(s) values into.
Returns
The objectInitialization json.

The documentation for this class was generated from the following file: