Table of Contents

Class ProductPackagingContentProfileBuilder

Namespace
S1API.Products
Assembly
S1API.dll

Builds an immutable product packaging-content profile.

public sealed class ProductPackagingContentProfileBuilder
Inheritance
ProductPackagingContentProfileBuilder
Inherited Members
Extension Methods

Constructors

ProductPackagingContentProfileBuilder()

public ProductPackagingContentProfileBuilder()

Methods

AddPlacement(ProductPresentationTransform)

Adds one explicit placement for a clone of the content prefab.

public ProductPackagingContentProfileBuilder AddPlacement(ProductPresentationTransform placement)

Parameters

placement ProductPresentationTransform

The clone's local transform inside the packaging shell.

Returns

ProductPackagingContentProfileBuilder

This builder.

Remarks

When no placements are added, S1API creates one clone and preserves the transform authored by the provider.

AddPlacements(params ProductPresentationTransform[])

Adds explicit placements for repeated clones of the content prefab.

public ProductPackagingContentProfileBuilder AddPlacements(params ProductPresentationTransform[] placements)

Parameters

placements ProductPresentationTransform[]

The clones' local transforms inside the packaging shell.

Returns

ProductPackagingContentProfileBuilder

This builder.

Build()

Creates an immutable packaging-content profile snapshot.

public ProductPackagingContentProfile Build()

Returns

ProductPackagingContentProfile

The packaging-content profile.

Exceptions

InvalidOperationException

Thrown when no visual source is configured or placements are combined with a complete-filled strategy.

WithCompleteFilledVisual(Func<GameObject?>, ProductPresentationTransform?)

Sets one complete mod-owned visual for packaging whose filled form is the product.

public ProductPackagingContentProfileBuilder WithCompleteFilledVisual(Func<GameObject?> provider, ProductPresentationTransform? transform = null)

Parameters

provider Func<GameObject>

A provider that returns a reusable complete visual source.

transform ProductPresentationTransform

An optional local transform applied to the cloned visual. When omitted, S1API preserves the transform authored by the provider.

Returns

ProductPackagingContentProfileBuilder

This builder.

Remarks

Use this for packaging such as brick, where the native variants represent the complete filled item instead of repeated contents inside a shared shell. The same strategy is applied to stored, equipped, and composite-icon contexts.

WithContent(Func<GameObject?>)

Sets the reusable mod-owned content prefab source.

public ProductPackagingContentProfileBuilder WithContent(Func<GameObject?> provider)

Parameters

provider Func<GameObject>

A provider that returns a reusable prefab source.

Returns

ProductPackagingContentProfileBuilder

This builder.

WithNativeFilledVisualScaffold(ProductPackagingVisualTemplate, Action<GameObject>?, ProductPresentationTransform?)

Clones one game-owned filled visual template and optionally customizes the clone.

public ProductPackagingContentProfileBuilder WithNativeFilledVisualScaffold(ProductPackagingVisualTemplate template, Action<GameObject>? customize = null, ProductPresentationTransform? transform = null)

Parameters

template ProductPackagingVisualTemplate

The presentation-only game-owned visual template.

customize Action<GameObject>

An optional callback that receives each newly cloned visual before it is shown. Only the clone is passed; shared game-owned prefabs are never exposed or mutated.

transform ProductPresentationTransform

An optional local transform applied to the clone. When omitted, S1API preserves the context-specific transform authored by the game-owned template.

Returns

ProductPackagingContentProfileBuilder

This builder.

Remarks

The template controls presentation only and does not alter the custom product's logical kind or native execution strategy. The callback should assign only mod-owned materials or other local presentation data.

Exceptions

ArgumentOutOfRangeException

Thrown when template is not a defined value.