Skip to content

LedDataSourceBase

ClassLEDStudioLEDStudio
public abstract class LedDataSourceBase : MonoBehaviour, ILedSource

Base class for data source components that sit alongside a 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

NameTypeDescription
sourceIdSystem.StringStable ID used to address and bind the source. An empty value preserves the current ID.
zoneSystem.Nullable{UnityEngine.Rect}Normalized board region occupied by the layer, or null for the full board.
fitModeLEDStudio.LedFitModeHow source pixels are fitted into the layer’s zone.
prioritySystem.Int32Composition order relative to other layers.
opacitySystem.SingleLayer opacity in the range from zero to one.
layerNameSystem.StringOptional display name. An empty value preserves the current name.
updateScheduleImpossibleRobert.Common.Timing.UpdateScheduleSettingsSchedule 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

NameType
targetResolutionUnityEngine.Vector2Int
public abstract void UpdateSource(in TimeStep step)

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

Parameters

NameType
stepImpossibleRobert.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

NameType
outRectsSystem.Collections.Generic.List{UnityEngine.RectInt}
public virtual void Release()

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

protected virtual bool RecoverUndoneReferences()

Reads back fields that point at scene objects an Undo restored, with ImpossibleRobert.Common.UnityUtils.TryRecoverUndoneReference<T1>(UnityEngine.Object, string, “ref 0). Returns true when a field changed. Editor only.

Returns

System.Boolean

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