skip to Main Content

Scripting Support (C#)

How to change the mask contents in play mode. Use the following methods:

MaskPaint(Vector3 pos, byte value, float brushWidth, float brushOpacity = 1f, float brushFuzziness = 0f, MaskPaintMethod paintMethod = MaskPaintMethod.BackgroundThread)

Use this method to change the opacity of snow (value) at any world position (pos) by painting with a brush of custom width (brushWidth) and intensity (brushOpacity/brushFuzziness).

MaskClear(byte value = 255)

Resets the internal snow mask with a default value of 255 (full opacity) or any other amount.

MaskFillArea(GameObject go, byte value, float opacity = 1f, float border = 0f);

Changes the opacity of snow under a gameobject. An overload of this function are included that accept a MeshRenderer.

public float GetSnowAmountAt(Vector3 position)

Returns an approximation of the amount of snow at a world position (0 = no snow, greater than 0 = snow)

public void MarkSnowAt(Vector3 position, float radius)

Leaves a mark on the snow at a given world space position and radius.

public void FootprintAt(Vector3 position, Vector3 moveDir)

Adds a footprint mark to the snow at the specified position and direction

UpdateSnowCoverage()

Forces a snow coverage update. This computes the snow occlusion from objects towards the ground.

RefreshExcludedObjects(performFullScan = false)

Recreates the exclusion command buffer. Call this method with performFullScan = true option if you add new objects or characters to the scene. In this case, you should also call UpdateSnowCoverage().

Note: if you want to exclude snow from your characters or any objects, it’s recommended to add the GlobalSnowIgnoreCoverage script to them instead of calling these methods.

Back To Top