Table of Contents

Class PuddlecraftSetup

Namespace
DFA.PuddlecraftEditor

Scripted project and scene setup for editor scripts, build scripts and CI, for example to set up many scenes the same way.

public static class PuddlecraftSetup
Inheritance
PuddlecraftSetup

Methods

AddRendererFeature(ScriptableRendererData, Type, string)

Adds a renderer feature of the given type to a URP renderer, with undo, unless the renderer already has one.

public static ScriptableRendererFeature AddRendererFeature(ScriptableRendererData data, Type featureType, string featureName)

Parameters

data ScriptableRendererData

The URP renderer data to add the feature to, usually a Universal Renderer Data asset.

featureType Type

The renderer feature type to add, for example typeof(PuddlecraftRendererFeature).

featureName string

The name the new feature gets in the renderer's feature list.

Returns

ScriptableRendererFeature

The feature of that type on the renderer: the existing one, the new one, or null if the renderer data can't take features.

BakeRainCover(PuddlecraftController, out string)

Bakes the rain cover map for the controller's scene and saves it in a folder next to the scene. The scene must be saved first.

public static bool BakeRainCover(PuddlecraftController controller, out string message)

Parameters

controller PuddlecraftController

The controller whose scene, receiver layers and occluder layers are baked.

message string

On success, a summary of the bake; on failure, why it failed.

Returns

bool

True if the cover map was baked and saved.

GetOrCreateController()

Returns the active Puddlecraft controller, creating one in the current stage (with undo) if there isn't one. In Prefab Mode none is created, so this returns null when no controller is enabled.

public static PuddlecraftController GetOrCreateController()

Returns

PuddlecraftController

RebakePuddles()

Throws away the live puddle bake and bakes the placed puddles of every open scene now, at full quality, with the active controller's settings. Save the scene afterwards to write the bake used in builds.

public static void RebakePuddles()