Class PolySpatialObjectUtils
Utility methods for working with PolySpatial objects.
Inherited Members
Namespace: Unity.PolySpatial
Assembly: Unity.PolySpatial.dll
Syntax
public static class PolySpatialObjectUtils
Methods
GetGameObjectForPolySpatialIdentifier(ulong)
Return the GameObject corresponding to the given identifier, if any.
Declaration
public static GameObject GetGameObjectForPolySpatialIdentifier(ulong id)
Parameters
Type | Name | Description |
---|---|---|
ulong | id | The PolySpatial identifier to get the GameObject for. |
Returns
Type | Description |
---|---|
GameObject | The GameObject, or null. |
GetPolySpatialIdentifier(GameObject)
Return an identifier usable by PolySpatial backends to obtain platform-specific resources.
Declaration
public static ulong GetPolySpatialIdentifier(GameObject go)
Parameters
Type | Name | Description |
---|---|---|
GameObject | go | The GameObject to get the identifier for. |
Returns
Type | Description |
---|---|
ulong | The identifier for the object. |
MarkDirty(RenderTexture)
Marks the specified render texture as changed so that it will be updated over PolySpatial.
Declaration
public static void MarkDirty(RenderTexture renderTexture)
Parameters
Type | Name | Description |
---|---|---|
RenderTexture | renderTexture | The render texture to mark as changed. |
MarkDirty(Renderer)
Marks the specified renderer as changed so that it will be updated over PolySpatial.
Declaration
public static void MarkDirty(Renderer renderer)
Parameters
Type | Name | Description |
---|---|---|
Renderer | renderer | The renderer to mark as changed. |
MarkFinal(Cubemap)
Marks the specified texture as "final," meaning that its contents will never be changed. This allows PolySpatial to unload Unity's copy of the texture after transferring it, reducing the total amount of memory used. Note that the texture will not be readable after being transferred.
Declaration
public static void MarkFinal(Cubemap texture)
Parameters
Type | Name | Description |
---|---|---|
Cubemap | texture | The texture to mark as final. |
MarkFinal(Mesh)
Marks the specified mesh as "final," meaning that its contents will never be changed. This allows PolySpatial to unload Unity's copy of the mesh after transferring it, reducing the total amount of memory used. Note that the mesh will not be readable after being transferred (it will be replaced with empty placeholder data).
Declaration
public static void MarkFinal(Mesh mesh)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | The mesh to mark as final. |
MarkFinal(Texture2D)
Marks the specified texture as "final," meaning that its contents will never be changed. This allows PolySpatial to unload Unity's copy of the texture after transferring it, reducing the total amount of memory used. Note that the texture will not be readable after being transferred.
Declaration
public static void MarkFinal(Texture2D texture)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | The texture to mark as final. |
MarkFinal(Texture3D)
Marks the specified texture as "final," meaning that its contents will never be changed. This allows PolySpatial to unload Unity's copy of the texture after transferring it, reducing the total amount of memory used. Note that the texture will not be readable after being transferred.
Declaration
public static void MarkFinal(Texture3D texture)
Parameters
Type | Name | Description |
---|---|---|
Texture3D | texture | The texture to mark as final. |
MarkUniversalCameraDataDirty(Camera)
Attempt to mark the UniversalAdditionalCameraData component dirty so that it will be updated over PolySpatial - if it doesn't exist or if UniversalRenderPipeline (URP) is disabled, this function does nothing.
Declaration
public static void MarkUniversalCameraDataDirty(Camera camera)
Parameters
Type | Name | Description |
---|---|---|
Camera | camera | The URP camera to mark dirty. Note that this function does not dirty the camera itself, but the UniversalAdditionalCameraData component attached to the camera. |