Difference between revisions of "GPU Instancer Pro:APIDocumentation"

From GurBu Wiki
Jump to: navigation, search
Line 2: Line 2:
  
  
== GPUICoreAPI ==
+
== Renderer Methods ==
 
 
 
<br>
 
<br>
 
==== RegisterRenderer ====
 
==== RegisterRenderer ====
Line 18: Line 17:
 
| <code>'''prefab'''</code> || GameObject that the renderers will be based on
 
| <code>'''prefab'''</code> || GameObject that the renderers will be based on
 
|-
 
|-
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
+
| <code>'''rendererKey'''</code> || Integer key output that uniquely identifies the renderer
 
|}
 
|}
 
<br>
 
<br>
Line 40: Line 39:
 
| <code>'''profile'''</code> || GPUIProfile that determines various rendering settings
 
| <code>'''profile'''</code> || GPUIProfile that determines various rendering settings
 
|-
 
|-
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
+
| <code>'''rendererKey'''</code> || Integer key output that uniquely identifies the renderer
 
|}
 
|}
 
<br>
 
<br>
Line 66: Line 65:
 
----
 
----
 
<br>
 
<br>
<code>public static bool '''SetMatrices'''(int '''rendererKey''', Matrix4x4[] matrices)</code>
+
<code>public static bool '''SetMatrices'''(int '''rendererKey''', Matrix4x4[] '''matrices''')</code>
 
<br><br>
 
<br><br>
 
{| class="wikitable"
 
{| class="wikitable"
Line 73: Line 72:
 
|-
 
|-
 
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 +
|-
 +
| <code>'''matrices'''</code> || Matrix4x4 collection that store the transform data of instances
 
|}
 
|}
 
<br>
 
<br>
Line 82: Line 83:
 
----
 
----
 
<br>
 
<br>
<code>public static bool '''SetMatrices'''(int '''rendererKey''', List<Matrix4x4> matrices)</code>
+
<code>public static bool '''SetMatrices'''(int '''rendererKey''', List<Matrix4x4> '''matrices''')</code>
 
<br><br>
 
<br><br>
 
{| class="wikitable"
 
{| class="wikitable"
Line 89: Line 90:
 
|-
 
|-
 
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 +
|-
 +
| <code>'''matrices'''</code> || Matrix4x4 collection that store the transform data of instances
 
|}
 
|}
 
<br>
 
<br>
Line 98: Line 101:
 
----
 
----
 
<br>
 
<br>
<code>public static bool '''SetMatrices'''(int '''rendererKey''', NativeArray<Matrix4x4> matrices)</code>
+
<code>public static bool '''SetMatrices'''(int '''rendererKey''', NativeArray<Matrix4x4> '''matrices''')</code>
 
<br><br>
 
<br><br>
 
{| class="wikitable"
 
{| class="wikitable"
Line 105: Line 108:
 
|-
 
|-
 
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 +
|-
 +
| <code>'''matrices'''</code> || Matrix4x4 collection that store the transform data of instances
 
|}
 
|}
 
<br>
 
<br>
Line 114: Line 119:
 
----
 
----
 
<br>
 
<br>
<code>public static bool '''SetBufferSize'''(int '''rendererKey''', int bufferSize)</code>
+
<code>public static bool '''SetBufferSize'''(int '''rendererKey''', int '''bufferSize''')</code>
 
<br><br>
 
<br><br>
 
{| class="wikitable"
 
{| class="wikitable"
Line 121: Line 126:
 
|-
 
|-
 
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 +
|-
 +
| <code>'''bufferSize'''</code> || Size of the buffer to allocate in GPU memory
 
|}
 
|}
 
<br>
 
<br>
Line 127: Line 134:
 
Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.<br><br><br><br>
 
Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.<br><br><br><br>
  
 +
 +
 +
== Camera Events ==
 +
<br>
 
==== AddCameraEventOnPreCull ====
 
==== AddCameraEventOnPreCull ====
 
----
 
----
 
<br>
 
<br>
<code>public static void '''AddCameraEventOnPreCull'''(UnityAction<GPUICameraData> cameraEvent)</code>
+
<code>public static void '''AddCameraEventOnPreCull'''(UnityAction<GPUICameraData> '''cameraEvent''')</code>
 
<br><br>
 
<br><br>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
!colspan="2" | Parameters
 
!colspan="2" | Parameters
 +
|-
 +
| <code>'''cameraEvent'''</code> || Action that will be executed for each camera
 
|}
 
|}
 
<br>
 
<br>
Line 144: Line 157:
 
----
 
----
 
<br>
 
<br>
<code>public static void '''RemoveCameraEventOnPreCull'''(UnityAction<GPUICameraData> cameraEvent)</code>
+
<code>public static void '''RemoveCameraEventOnPreCull'''(UnityAction<GPUICameraData> '''cameraEvent''')</code>
 
<br><br>
 
<br><br>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
!colspan="2" | Parameters
 
!colspan="2" | Parameters
 +
|-
 +
| <code>'''cameraEvent'''</code> || Action that is previously added with the AddCameraEvent method
 
|}
 
|}
 
<br>
 
<br>
Line 158: Line 173:
 
----
 
----
 
<br>
 
<br>
<code>public static void '''AddCameraEventOnPreRender'''(UnityAction<GPUICameraData> cameraEvent)</code>
+
<code>public static void '''AddCameraEventOnPreRender'''(UnityAction<GPUICameraData> '''cameraEvent''')</code>
 
<br><br>
 
<br><br>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
!colspan="2" | Parameters
 
!colspan="2" | Parameters
 +
|-
 +
| <code>'''cameraEvent'''</code> || Action that will be executed for each camera
 
|}
 
|}
 
<br>
 
<br>
Line 172: Line 189:
 
----
 
----
 
<br>
 
<br>
<code>public static void '''RemoveCameraEventOnPreRender'''(UnityAction<GPUICameraData> cameraEvent)</code>
+
<code>public static void '''RemoveCameraEventOnPreRender'''(UnityAction<GPUICameraData> '''cameraEvent''')</code>
 
<br><br>
 
<br><br>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
!colspan="2" | Parameters
 
!colspan="2" | Parameters
 +
|-
 +
| <code>'''cameraEvent'''</code> || Action that is previously added with the AddCameraEvent method
 
|}
 
|}
 
<br>
 
<br>
Line 186: Line 205:
 
----
 
----
 
<br>
 
<br>
<code>public static void '''AddCameraEventOnPostRender'''(UnityAction<GPUICameraData> cameraEvent)</code>
+
<code>public static void '''AddCameraEventOnPostRender'''(UnityAction<GPUICameraData> '''cameraEvent''')</code>
 
<br><br>
 
<br><br>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
!colspan="2" | Parameters
 
!colspan="2" | Parameters
 +
|-
 +
| <code>'''cameraEvent'''</code> || Action that will be executed for each camera
 
|}
 
|}
 
<br>
 
<br>
Line 200: Line 221:
 
----
 
----
 
<br>
 
<br>
<code>public static void '''RemoveCameraEventOnPostRender'''(UnityAction<GPUICameraData> cameraEvent)</code>
+
<code>public static void '''RemoveCameraEventOnPostRender'''(UnityAction<GPUICameraData> '''cameraEvent''')</code>
 
<br><br>
 
<br><br>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
!colspan="2" | Parameters
 
!colspan="2" | Parameters
 +
|-
 +
| <code>'''cameraEvent'''</code> || Action that is previously added with the AddCameraEvent method
 
|}
 
|}
 
<br>
 
<br>
Line 210: Line 233:
 
<br><br>
 
<br><br>
 
Removes the method previously added with the AddCameraEventOnPostRender method.<br><br><br><br>
 
Removes the method previously added with the AddCameraEventOnPostRender method.<br><br><br><br>
 +
 +
 +
 +
== Prefab Module ==
 +
<br>
 +
==== AddPrototype ====
 +
----
 +
<br>
 +
<code>public static int '''AddPrototype'''(GPUIPrefabManager ''''''prefab'''Manager''', GameObject '''prefab''')</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''prefabManager'''</code> ||
 +
|-
 +
| <code>'''prefab'''</code> ||
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds the given GameObject as a prototype to the Prefab Manager<br><br><br><br>
 +
 +
==== AddPrefabInstance ====
 +
----
 +
<br>
 +
<code>public static void '''AddPrefabInstance'''(GPUIPrefab '''gpuiPrefab''')</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''gpuiPrefab'''</code> ||
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds the prefab instance to an existing Prefab Manager. The corresponding prefab should be defined as a prototype on the Prefab Manager. The prefab instance will be registered on the Prefab Manager with the manager's next LateUpdate. If you wish to add the instance immediately, please use the AddPrefabInstanceImmediate(GPUIPrefab) method.<br><br><br><br>
 +
 +
==== AddPrefabInstances ====
 +
----
 +
<br>
 +
<code>public static void '''AddPrefabInstances'''(IEnumerable<GPUIPrefab> '''gpuiPrefabs''')</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''gpuiPrefabs'''</code> ||
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds the collection of prefab instances to an existing Prefab Manager. The corresponding prefabs should be defined as a prototype on the Prefab Manager. The instances will be registered on the Prefab Manager with manager's next LateUpdate. If you wish to add the instances immediately, please use the AddPrefabInstanceImmediate(GPUIPrefab) method.<br><br><br><br>
 +
 +
==== AddPrefabInstances ====
 +
----
 +
<br>
 +
<code>public static bool '''AddPrefabInstances'''(GPUIPrefabManager '''prefabManager''', IEnumerable<GPUIPrefab> '''instances''', int '''prototypeIndex''')</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''prefabManager'''</code> ||
 +
|-
 +
| <code>'''instances'''</code> || Collection of instances of a specific prefab
 +
|-
 +
| <code>'''prototypeIndex'''</code> || The prototype index of the prefab on the Prefab Manager
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds the collection of instances of a specific prefab to the Prefab Manager. The instances will be registered on the Prefab Manager with manager's next LateUpdate. If you wish to add the instances immediately, please use the AddPrefabInstanceImmediate(GPUIPrefab) method.<br><br><br><br>
 +
 +
==== AddPrefabInstance ====
 +
----
 +
<br>
 +
<code>public static bool '''AddPrefabInstance'''(GPUIPrefabManager '''prefabManager''', GameObject '''go''', int '''prototypeIndex''')</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''prefabManager'''</code> ||
 +
|-
 +
| <code>'''go'''</code> ||
 +
|-
 +
| <code>'''prototypeIndex'''</code> || The prototype index of the prefab on the Prefab Manager
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds the prefab instance to the Prefab Manager. The instances will be registered on the Prefab Manager with manager's next LateUpdate. If you wish to add the instance immediately, please use the AddPrefabInstanceImmediate method.<br><br><br><br>
 +
 +
==== AddPrefabInstance ====
 +
----
 +
<br>
 +
<code>public static bool '''AddPrefabInstance'''(GPUIPrefabManager '''prefabManager''', GPUIPrefab '''gpuiPrefab''', int '''prototypeIndex''' = -1)</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''prefabManager'''</code> ||
 +
|-
 +
| <code>'''gpuiPrefab'''</code> ||
 +
|-
 +
| <code>'''prototypeIndex'''</code> || The prototype index of the prefab on the Prefab Manager
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds the prefab instance to the Prefab Manager. The instances will be registered on the Prefab Manager with manager's next LateUpdate. If you wish to add the instance immediately, please use the AddPrefabInstanceImmediate(GPUIPrefab) method.<br><br><br><br>
 +
 +
==== AddPrefabInstanceImmediate ====
 +
----
 +
<br>
 +
<code>public static int '''AddPrefabInstanceImmediate'''(GPUIPrefabManager '''prefabManager''', GPUIPrefab '''gpuiPrefab''', int '''prototypeIndex''' = -1)</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''prefabManager'''</code> ||
 +
|-
 +
| <code>'''gpuiPrefab'''</code> ||
 +
|-
 +
| <code>'''prototypeIndex'''</code> ||
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Immediately adds the prefab instance to the Prefab Manager without waiting for LateUpdate.<br><br><br><br>
 +
 +
==== RemovePrefabInstance ====
 +
----
 +
<br>
 +
<code>public static void '''RemovePrefabInstance'''(GPUIPrefab '''gpuiPrefab''')</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''gpuiPrefab'''</code> ||
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Removes the prefab instance from the Prefab Manager.<br><br><br><br>
 +
 +
==== UpdateTransformData ====
 +
----
 +
<br>
 +
<code>public static void '''UpdateTransformData'''(GPUIPrefabManager '''prefabManager''')</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''prefabManager'''</code> ||
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Notifies the Prefab Manager to update the transform data buffers.<br><br><br><br>
 +
 +
==== UpdateTransformData ====
 +
----
 +
<br>
 +
<code>public static void '''UpdateTransformData'''(GPUIPrefabManager '''prefabManager''', GPUIPrefab '''gpuiPrefab''')</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''prefabManager'''</code> ||
 +
|-
 +
| <code>'''gpuiPrefab'''</code> ||
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Updates the Matrix4x4 data for the given prefab instance.<br><br><br><br>
 +
 +
 +
 +
== Terrain Methods ==
 +
<br>
 +
==== AddTerrains<T> ====
 +
----
 +
<br>
 +
<code>public static void '''AddTerrains<T>'''(GPUITerrainManager<T> '''terrainManager''', IEnumerable<Terrain> '''terrains''') where T : GPUIPrototypeData, new()</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''terrainManager'''</code> || The Tree or Detail Manager to which the terrain will be added
 +
|-
 +
| <code>'''terrains'''</code> || Collection of terrains to add to the manager
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds the given terrain collection to the Detail or Tree Manager.<br><br><br><br>
 +
 +
==== AddTerrains<T> ====
 +
----
 +
<br>
 +
<code>public static void '''AddTerrains<T>'''(GPUITerrainManager<T> '''terrainManager''', IEnumerable<GPUITerrain> '''gpuiTerrains''') where T : GPUIPrototypeData, new()</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''terrainManager'''</code> || The Tree or Detail Manager to which the terrain will be added
 +
|-
 +
| <code>'''gpuiTerrains'''</code> || Collection of GPUI terrains to add to the manager
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds the given terrain collection to the Detail or Tree Manager.<br><br><br><br>
 +
 +
==== AddTerrain<T> ====
 +
----
 +
<br>
 +
<code>public static bool '''AddTerrain<T>'''(GPUITerrainManager<T> ''''''terrain'''Manager''', Terrain '''terrain''') where T : GPUIPrototypeData, new()</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''terrainManager'''</code> || The Tree or Detail Manager to which the terrain will be added
 +
|-
 +
| <code>'''terrain'''</code> || Terrain to add to the manager
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds the given terrain to the Detail or Tree Manager.<br><br><br><br>
 +
 +
==== AddTerrain<T> ====
 +
----
 +
<br>
 +
<code>public static bool '''AddTerrain<T>'''(GPUITerrainManager<T> '''terrainManager''', GPUITerrain '''gpuiTerrain''') where T : GPUIPrototypeData, new()</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''terrainManager'''</code> || The Tree or Detail Manager to which the terrain will be added
 +
|-
 +
| <code>'''gpuiTerrain'''</code> || GPUI terrain to add to the manager
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds the given terrain to the Detail or Tree Manager.<br><br><br><br>
 +
 +
==== RemoveTerrain<T> ====
 +
----
 +
<br>
 +
<code>public static bool '''RemoveTerrain<T>'''(GPUITerrainManager<T> ''''''terrain'''Manager''', Terrain '''terrain''') where T : GPUIPrototypeData, new()</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''terrainManager'''</code> || The Tree or Detail Manager from which the terrain will be removed
 +
|-
 +
| <code>'''terrain'''</code> || Terrain to remove from the manager
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Removes the given terrain from the Detail or Tree Manager.<br><br><br><br>
 +
 +
==== RemoveTerrain<T> ====
 +
----
 +
<br>
 +
<code>public static bool '''RemoveTerrain<T>'''(GPUITerrainManager<T> '''terrainManager''', GPUITerrain '''gpuiTerrain''') where T : GPUIPrototypeData, new()</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''terrainManager'''</code> || The Tree or Detail Manager from which the terrain will be removed
 +
|-
 +
| <code>'''gpuiTerrain'''</code> || GPUI terrain to remove from the manager
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Removes the given terrain from the Detail or Tree Manager.<br><br><br><br>

Revision as of 13:36, 11 April 2024

About GPU Instance Pro | Getting Started | Terminology | Best Practices | API Documentation | F.A.Q.


Renderer Methods


RegisterRenderer



public static bool RegisterRenderer(UnityEngine.Object source, GameObject prefab, out int rendererKey)

Parameters
source The source responsible for registering the renderer. E.g. the MonoBehaviour class
prefab GameObject that the renderers will be based on
rendererKey Integer key output that uniquely identifies the renderer


Description:

The RegisterRenderer method is used to set up GPUI renderers for the specified GameObject. This method needs to be called to produce a renderKey, which can then be used with the SetMatrices method to start rendering instances with the given transform matrices. To stop the rendering, the DisposeRenderer method should be called with the rendererKey output.



RegisterRenderer



public static bool RegisterRenderer(UnityEngine.Object source, GameObject prefab, GPUIProfile profile, out int rendererKey)

Parameters
source The source responsible for registering the renderer. E.g. the MonoBehaviour class
prefab GameObject that the renderers will be based on
profile GPUIProfile that determines various rendering settings
rendererKey Integer key output that uniquely identifies the renderer


Description:

The RegisterRenderer method is used to set up GPUI renderers for the specified GameObject. This method needs to be called to produce a renderKey, which can then be used with the SetMatrices method to start rendering instances with the given transform matrices. To stop the rendering, the DisposeRenderer method should be called with the rendererKey output.



DisposeRenderer



public static void DisposeRenderer(int rendererKey)

Parameters
rendererKey Integer key that uniquely identifies the renderer


Description:

Disposes the renderer data previously defined with the RegisterRenderer method.



SetMatrices



public static bool SetMatrices(int rendererKey, Matrix4x4[] matrices)

Parameters
rendererKey Integer key that uniquely identifies the renderer
matrices Matrix4x4 collection that store the transform data of instances


Description:

Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.



SetMatrices



public static bool SetMatrices(int rendererKey, List<Matrix4x4> matrices)

Parameters
rendererKey Integer key that uniquely identifies the renderer
matrices Matrix4x4 collection that store the transform data of instances


Description:

Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.



SetMatrices



public static bool SetMatrices(int rendererKey, NativeArray<Matrix4x4> matrices)

Parameters
rendererKey Integer key that uniquely identifies the renderer
matrices Matrix4x4 collection that store the transform data of instances


Description:

Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.



SetBufferSize



public static bool SetBufferSize(int rendererKey, int bufferSize)

Parameters
rendererKey Integer key that uniquely identifies the renderer
bufferSize Size of the buffer to allocate in GPU memory


Description:

Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.




Camera Events


AddCameraEventOnPreCull



public static void AddCameraEventOnPreCull(UnityAction<GPUICameraData> cameraEvent)

Parameters
cameraEvent Action that will be executed for each camera


Description:

Adds a method to execute before each camera's visibility calculations.



RemoveCameraEventOnPreCull



public static void RemoveCameraEventOnPreCull(UnityAction<GPUICameraData> cameraEvent)

Parameters
cameraEvent Action that is previously added with the AddCameraEvent method


Description:

Removes the method previously added with the AddCameraEventOnPreCull method.



AddCameraEventOnPreRender



public static void AddCameraEventOnPreRender(UnityAction<GPUICameraData> cameraEvent)

Parameters
cameraEvent Action that will be executed for each camera


Description:

Adds a method to execute after each camera's visibility calculations and before draw calls.



RemoveCameraEventOnPreRender



public static void RemoveCameraEventOnPreRender(UnityAction<GPUICameraData> cameraEvent)

Parameters
cameraEvent Action that is previously added with the AddCameraEvent method


Description:

Removes the method previously added with the AddCameraEventOnPreRender method.



AddCameraEventOnPostRender



public static void AddCameraEventOnPostRender(UnityAction<GPUICameraData> cameraEvent)

Parameters
cameraEvent Action that will be executed for each camera


Description:

Adds a method to execute after each camera's draw calls.



RemoveCameraEventOnPostRender



public static void RemoveCameraEventOnPostRender(UnityAction<GPUICameraData> cameraEvent)

Parameters
cameraEvent Action that is previously added with the AddCameraEvent method


Description:

Removes the method previously added with the AddCameraEventOnPostRender method.




Prefab Module


AddPrototype



public static int AddPrototype'(GPUIPrefabManager 'prefabManager, GameObject prefab)

Parameters
prefabManager
prefab


Description:

Adds the given GameObject as a prototype to the Prefab Manager



AddPrefabInstance



public static void AddPrefabInstance(GPUIPrefab gpuiPrefab)

Parameters
gpuiPrefab


Description:

Adds the prefab instance to an existing Prefab Manager. The corresponding prefab should be defined as a prototype on the Prefab Manager. The prefab instance will be registered on the Prefab Manager with the manager's next LateUpdate. If you wish to add the instance immediately, please use the AddPrefabInstanceImmediate(GPUIPrefab) method.



AddPrefabInstances



public static void AddPrefabInstances(IEnumerable<GPUIPrefab> gpuiPrefabs)

Parameters
gpuiPrefabs


Description:

Adds the collection of prefab instances to an existing Prefab Manager. The corresponding prefabs should be defined as a prototype on the Prefab Manager. The instances will be registered on the Prefab Manager with manager's next LateUpdate. If you wish to add the instances immediately, please use the AddPrefabInstanceImmediate(GPUIPrefab) method.



AddPrefabInstances



public static bool AddPrefabInstances(GPUIPrefabManager prefabManager, IEnumerable<GPUIPrefab> instances, int prototypeIndex)

Parameters
prefabManager
instances Collection of instances of a specific prefab
prototypeIndex The prototype index of the prefab on the Prefab Manager


Description:

Adds the collection of instances of a specific prefab to the Prefab Manager. The instances will be registered on the Prefab Manager with manager's next LateUpdate. If you wish to add the instances immediately, please use the AddPrefabInstanceImmediate(GPUIPrefab) method.



AddPrefabInstance



public static bool AddPrefabInstance(GPUIPrefabManager prefabManager, GameObject go, int prototypeIndex)

Parameters
prefabManager
go
prototypeIndex The prototype index of the prefab on the Prefab Manager


Description:

Adds the prefab instance to the Prefab Manager. The instances will be registered on the Prefab Manager with manager's next LateUpdate. If you wish to add the instance immediately, please use the AddPrefabInstanceImmediate method.



AddPrefabInstance



public static bool AddPrefabInstance(GPUIPrefabManager prefabManager, GPUIPrefab gpuiPrefab, int prototypeIndex = -1)

Parameters
prefabManager
gpuiPrefab
prototypeIndex The prototype index of the prefab on the Prefab Manager


Description:

Adds the prefab instance to the Prefab Manager. The instances will be registered on the Prefab Manager with manager's next LateUpdate. If you wish to add the instance immediately, please use the AddPrefabInstanceImmediate(GPUIPrefab) method.



AddPrefabInstanceImmediate



public static int AddPrefabInstanceImmediate(GPUIPrefabManager prefabManager, GPUIPrefab gpuiPrefab, int prototypeIndex = -1)

Parameters
prefabManager
gpuiPrefab
prototypeIndex


Description:

Immediately adds the prefab instance to the Prefab Manager without waiting for LateUpdate.



RemovePrefabInstance



public static void RemovePrefabInstance(GPUIPrefab gpuiPrefab)

Parameters
gpuiPrefab


Description:

Removes the prefab instance from the Prefab Manager.



UpdateTransformData



public static void UpdateTransformData(GPUIPrefabManager prefabManager)

Parameters
prefabManager


Description:

Notifies the Prefab Manager to update the transform data buffers.



UpdateTransformData



public static void UpdateTransformData(GPUIPrefabManager prefabManager, GPUIPrefab gpuiPrefab)

Parameters
prefabManager
gpuiPrefab


Description:

Updates the Matrix4x4 data for the given prefab instance.




Terrain Methods


AddTerrains<T>



public static void AddTerrains<T>(GPUITerrainManager<T> terrainManager, IEnumerable<Terrain> terrains) where T : GPUIPrototypeData, new()

Parameters
terrainManager The Tree or Detail Manager to which the terrain will be added
terrains Collection of terrains to add to the manager


Description:

Adds the given terrain collection to the Detail or Tree Manager.



AddTerrains<T>



public static void AddTerrains<T>(GPUITerrainManager<T> terrainManager, IEnumerable<GPUITerrain> gpuiTerrains) where T : GPUIPrototypeData, new()

Parameters
terrainManager The Tree or Detail Manager to which the terrain will be added
gpuiTerrains Collection of GPUI terrains to add to the manager


Description:

Adds the given terrain collection to the Detail or Tree Manager.



AddTerrain<T>



public static bool AddTerrain<T>'(GPUITerrainManager<T> 'terrainManager, Terrain terrain) where T : GPUIPrototypeData, new()

Parameters
terrainManager The Tree or Detail Manager to which the terrain will be added
terrain Terrain to add to the manager


Description:

Adds the given terrain to the Detail or Tree Manager.



AddTerrain<T>



public static bool AddTerrain<T>(GPUITerrainManager<T> terrainManager, GPUITerrain gpuiTerrain) where T : GPUIPrototypeData, new()

Parameters
terrainManager The Tree or Detail Manager to which the terrain will be added
gpuiTerrain GPUI terrain to add to the manager


Description:

Adds the given terrain to the Detail or Tree Manager.



RemoveTerrain<T>



public static bool RemoveTerrain<T>'(GPUITerrainManager<T> 'terrainManager, Terrain terrain) where T : GPUIPrototypeData, new()

Parameters
terrainManager The Tree or Detail Manager from which the terrain will be removed
terrain Terrain to remove from the manager


Description:

Removes the given terrain from the Detail or Tree Manager.



RemoveTerrain<T>



public static bool RemoveTerrain<T>(GPUITerrainManager<T> terrainManager, GPUITerrain gpuiTerrain) where T : GPUIPrototypeData, new()

Parameters
terrainManager The Tree or Detail Manager from which the terrain will be removed
gpuiTerrain GPUI terrain to remove from the manager


Description:

Removes the given terrain from the Detail or Tree Manager.