Skip to content

MockStream

ClassMockMagiccom.wetzold.mock-magic
public class MockStream : MonoBehaviour

Continuous mock data streaming to registered listeners. Works in both Play Mode (via coroutines) and Edit Mode (via editor updates).

public void Register(Action<MockDataPoint[]> listener)

Register a listener to receive data emissions.

Parameters

Name Type
listener System.Action{MockMagic.MockDataPoint[]}
public void Unregister(Action<MockDataPoint[]> listener)

Unregister a listener.

Parameters

Name Type
listener System.Action{MockMagic.MockDataPoint[]}
public void ClearListeners()

Clear all registered listeners.

public void StartStream()

Start the data stream.

public void StopStream()

Stop the data stream.

public void Toggle()

Toggle the stream on/off.

public void EmitOnce()

Emit data once manually.

public MockStream()

public static MockStream Instance { get; }

Gets or creates the MockStream instance.

Returns

MockMagic.MockStream

public SeriesPattern Pattern { get; set; }

The pattern to use for generating series data.

Returns

MockMagic.SeriesPattern

public StreamRhythm Rhythm { get; set; }

The rhythm mode for emitting data.

Returns

MockMagic.StreamRhythm

public ClockMode ClockMode { get; set; }

Clock source used for automatic stream emissions.

Returns

ImpossibleRobert.Common.Timing.ClockMode

public float Interval { get; set; }

Base interval between emissions in seconds.

Returns

System.Single

public float MinInterval { get; set; }

Minimum interval for random rhythm.

Returns

System.Single

public float MaxInterval { get; set; }

Maximum interval for random rhythm.

Returns

System.Single

public int PointsPerEmission { get; set; }

Number of points to generate per emission.

Returns

System.Int32

public int BurstCount { get; set; }

Number of emissions per burst (for Burst rhythm).

Returns

System.Int32

public float BurstDelay { get; set; }

Delay between bursts.

Returns

System.Single

public float MinValue { get; set; }

Minimum value for generated data.

Returns

System.Single

public float MaxValue { get; set; }

Maximum value for generated data.

Returns

System.Single

public float Noise { get; set; }

Noise factor for generated data.

Returns

System.Single

public LabelPreset LabelPreset { get; set; }

Label preset for generated data.

Returns

MockMagic.LabelPreset

public bool IsRunning { get; }

Whether the stream is currently running.

Returns

System.Boolean

public int ListenerCount { get; }

Gets the count of registered listeners.

Returns

System.Int32

public event Action<MockDataPoint[]> OnDataEmitted

Event fired when new data points are generated.

Returns

System.Action{MockMagic.MockDataPoint[]}

public event Action OnStreamStarted

Event fired when the stream starts.

Returns

System.Action

public event Action OnStreamStopped

Event fired when the stream stops.

Returns

System.Action