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(UIBehaviour)
Marks the specified UIBehaviour as dirty so that it will be updated over PolySpatial.
Declaration
public static void MarkDirty(UIBehaviour behaviour)
Parameters
| Type | Name | Description |
|---|---|---|
| UIBehaviour | behaviour | The behaviour to mark as dirty. |
MarkDirty(Material)
Marks the specified material as changed so that it will be updated over PolySpatial.
Declaration
public static void MarkDirty(Material material)
Parameters
| Type | Name | Description |
|---|---|---|
| Material | material | The material 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. |
MarkDirty(Texture)
Marks the specified texture as changed so that it will be updated over PolySpatial.
Declaration
public static void MarkDirty(Texture texture)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture | texture | The texture 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. |
SetStreaming(Texture, bool)
Sets or clears a texture's streaming flag, where streaming means that we expect it to change frequently. This acts as a hint to PolySpatial that it should treat it as it would a RenderTexture, which is useful when the texture comes from an external source.
Declaration
public static void SetStreaming(Texture texture, bool streaming = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture | texture | The texture whose streaming flag should be set or cleared. |
| bool | streaming | Whether to set or clear the streaming flag. |