Hydrogen Framework
1.3.1
|
A drop in implementation of how to interact with the Hydrogen.Threading.Jobs.MeshCombiner. This is meant really as an example of one way of using it, but you will probably want to create your own method to further optimize the workflow. More...
Public Member Functions | |
void | Combine (GameObject rootObject, Transform outputParent, bool disableRootObject) |
Combine all active meshes under the root object. More... | |
void | ThreadCallback (int hash, Hydrogen.Threading.Jobs.MeshCombiner.MeshOutput[] meshOutputs) |
This function is called in the example after the MeshCombiner has processed the meshes, it starts a Coroutine to create the actual meshes based on the flat data. This is the most optimal way to do this sadly as we cannot create or touch Unity based meshes outside of the main thread. More... | |
Static Public Member Functions | |
static bool | Exists () |
Does an Input Manager already exist? More... | |
Public Attributes | |
Hydrogen.Threading.Jobs.MeshCombiner | Combiner = new Hydrogen.Threading.Jobs.MeshCombiner () |
An instance of the MeshCombiner. More... | |
int | ThrottleRate = 180 |
This is used in our example to throttle things a bit when accessing Unity objects. More... | |
bool | Persistent = true |
Should this input manager survive scene switches? More... | |
Protected Member Functions | |
void | Awake () |
Unity's Awake Event More... | |
Properties | |
static hMeshCombiner | Instance [get] |
Gets the input manager instance, creating one if none is found. More... | |
A drop in implementation of how to interact with the Hydrogen.Threading.Jobs.MeshCombiner. This is meant really as an example of one way of using it, but you will probably want to create your own method to further optimize the workflow.
Definition at line 40 of file hMeshCombiner.cs.
|
protected |
Unity's Awake Event
Definition at line 193 of file hMeshCombiner.cs.
void hMeshCombiner.Combine | ( | GameObject | rootObject, |
Transform | outputParent, | ||
bool | disableRootObject | ||
) |
Combine all active meshes under the root object.
You do not need to wait till completion to call this again with more meshes to combine, however the thread will not call back to Unity till all meshes have been processed in the queue.
rootObject | The "root" GameObject. |
outputParent | Sets the output parent transform. |
disableRootObject | If set to true disable root object (and its children) after iterating through its children.. |
Definition at line 125 of file hMeshCombiner.cs.
|
static |
Does an Input Manager already exist?
Definition at line 107 of file hMeshCombiner.cs.
void hMeshCombiner.ThreadCallback | ( | int | hash, |
Hydrogen.Threading.Jobs.MeshCombiner.MeshOutput[] | meshOutputs | ||
) |
This function is called in the example after the MeshCombiner has processed the meshes, it starts a Coroutine to create the actual meshes based on the flat data. This is the most optimal way to do this sadly as we cannot create or touch Unity based meshes outside of the main thread.
hash | Instance Hash. |
meshOutputs | . |
Definition at line 143 of file hMeshCombiner.cs.
Hydrogen.Threading.Jobs.MeshCombiner hMeshCombiner.Combiner = new Hydrogen.Threading.Jobs.MeshCombiner () |
An instance of the MeshCombiner.
Definition at line 45 of file hMeshCombiner.cs.
bool hMeshCombiner.Persistent = true |
Should this input manager survive scene switches?
Definition at line 54 of file hMeshCombiner.cs.
int hMeshCombiner.ThrottleRate = 180 |
This is used in our example to throttle things a bit when accessing Unity objects.
It seems at 180, its a nice sweet spot for the meshes in our example scene.
Definition at line 50 of file hMeshCombiner.cs.
|
staticget |
Gets the input manager instance, creating one if none is found.
The Input Manager.
Definition at line 84 of file hMeshCombiner.cs.