Table of Contents

Class NPCSprayPainting

Namespace
S1API.Entities.Actions
Assembly
S1API.dll

Wraps the spray painting action for an NPC. Use to equip the spray can, toggle spray effects, and control the animation.

public sealed class NPCSprayPainting
Inheritance
NPCSprayPainting
Inherited Members
Extension Methods

Remarks

Requires the spray paint component to be configured on the prefab via EnsureGraffiti(string?). If not present, Begin(), End(), and SetEffect(bool, Color) are no-ops.

Properties

IsActive

Whether the spray painting action is currently active (spray can equipped, animation playing).

public bool IsActive { get; }

Property Value

bool

Methods

Begin()

Begins the spray painting action: equips the spray can and plays the UseSprayCan animation.

public void Begin()

Remarks

No-op if the spray paint component is not on the prefab. Call EnsureGraffiti(string?) during ConfigurePrefab to add it.

End()

Ends the spray painting action: unequips the spray can and stops the animation.

public void End()

SetEffect(bool, Color)

Sets the spray effect (particle and sound) on or off.

public void SetEffect(bool enabled, Color color = null)

Parameters

enabled bool

Whether the spray effect should be visible and audible.

color Color

Color for the spray particles when enabling. Ignored when disabling.