Skip to content

LedDataSourceBase

ClassLEDStudioLEDStudio
public abstract class LedDataSourceBase : MonoBehaviour, ILedSource

Base class for data source components that sit alongside a LEDStudio.LedBoardController and automatically feed content into the board. Add one of the concrete subclasses (LedTextDataSource, LedImageDataSource, LedVideoDataSource, LedRenderTextureDataSource, LedTimerDataSource, LedScoreDataSource) to the same GameObject or a child, and it will be discovered automatically — no manual wiring needed.

ConfigureRuntimeLayer(string, Rect?, LedFitMode, int, float, string, UpdateScheduleSettings)

Section titled “ConfigureRuntimeLayer(string, Rect?, LedFitMode, int, float, string, UpdateScheduleSettings)”
public void ConfigureRuntimeLayer(string sourceId, Rect? zone = null, LedFitMode fitMode = LedFitMode.Fit, int priority = 0, float opacity = 1, string layerName = null, UpdateScheduleSettings updateSchedule = default)

Configures this component as a runtime composition layer and invalidates its current output.

Parameters

Name Type Description
sourceId System.String Stable ID used to address and bind the source. An empty value preserves the current ID.
zone System.Nullable{UnityEngine.Rect} Normalized board region occupied by the layer, or null for the full board.
fitMode LEDStudio.LedFitMode How source pixels are fitted into the layer’s zone.
priority System.Int32 Composition order relative to other layers.
opacity System.Single Layer opacity in the range from zero to one.
layerName System.String Optional display name. An empty value preserves the current name.
updateSchedule ImpossibleRobert.Common.Timing.UpdateScheduleSettings Schedule that controls when the source produces new frames.
public abstract void Prepare(Vector2Int targetResolution)

Allocates or resizes source resources for the requested logical board resolution.

Parameters

Name Type
targetResolution UnityEngine.Vector2Int
public abstract void UpdateSource(in TimeStep step)

Updates time-dependent content using the board’s deterministic simulation step.

Parameters

Name Type
step ImpossibleRobert.Common.Timing.TimeStep
public abstract void MarkClean()

Clears dirty state after the compositor consumes the current output.

public virtual void GetDirtyRects(List<RectInt> outRects)

Appends source-space rectangles that changed since the last clean frame.

Parameters

Name Type
outRects System.Collections.Generic.List{UnityEngine.RectInt}
public virtual void Release()

Releases textures and other resources owned by the source; repeated calls must be safe.

protected LedDataSourceBase()

public string SourceId { get; }

Returns

System.String

public string LayerName { get; }

Returns

System.String

public int Priority { get; }

Returns

System.Int32

public float Opacity { get; }

Returns

System.Single

public LedFitMode FitMode { get; }

Returns

LEDStudio.LedFitMode

public Rect Zone { get; }

Returns

UnityEngine.Rect

public UpdateScheduleSettings UpdateSchedule { get; }

Returns

ImpossibleRobert.Common.Timing.UpdateScheduleSettings

public abstract LedSourceType SourceType { get; }

Returns

LEDStudio.LedSourceType

public abstract bool IsReady { get; }

Returns

System.Boolean

public abstract bool IsDirty { get; }

Returns

System.Boolean

public abstract Texture OutputTexture { get; }

Returns

UnityEngine.Texture