MockStream
public class MockStream : MonoBehaviourContinuous mock data streaming to registered listeners. Works in both Play Mode (via coroutines) and Edit Mode (via editor updates).
Methods
Section titled “Methods”
Register(Action<MockDataPoint[]>)
Section titled “Register(Action<MockDataPoint[]>)”public void Register(Action<MockDataPoint[]> listener)Register a listener to receive data emissions.
Parameters
| Name | Type |
|---|---|
listener | System.Action{MockMagic.MockDataPoint[]} |
Unregister(Action<MockDataPoint[]>)
Section titled “Unregister(Action<MockDataPoint[]>)”public void Unregister(Action<MockDataPoint[]> listener)Unregister a listener.
Parameters
| Name | Type |
|---|---|
listener | System.Action{MockMagic.MockDataPoint[]} |
ClearListeners()
Section titled “ClearListeners()”public void ClearListeners()Clear all registered listeners.
StartStream()
Section titled “StartStream()”public void StartStream()Start the data stream.
StopStream()
Section titled “StopStream()”public void StopStream()Stop the data stream.
Toggle()
Section titled “Toggle()”public void Toggle()Toggle the stream on/off.
EmitOnce()
Section titled “EmitOnce()”public void EmitOnce()Emit data once manually.
Constructors
Section titled “Constructors”
MockStream()
Section titled “MockStream()”public MockStream()Properties
Section titled “Properties”
Instance
Section titled “Instance”public static MockStream Instance { get; }Gets or creates the shared stream used by MockStreaming and the Generator. It lives on its own
hidden GameObject; MockStream components in your scenes are never adopted, so they stream independently.
Returns
MockMagic.MockStream
Pattern
Section titled “Pattern”public SeriesPattern Pattern { get; set; }The pattern to use for generating series data.
Returns
MockMagic.SeriesPattern
Rhythm
Section titled “Rhythm”public StreamRhythm Rhythm { get; set; }The rhythm mode for emitting data.
Returns
MockMagic.StreamRhythm
ClockMode
Section titled “ClockMode”public ClockMode ClockMode { get; set; }Clock source used for automatic stream emissions.
Returns
ImpossibleRobert.Common.Timing.ClockMode
Interval
Section titled “Interval”public float Interval { get; set; }Base interval between emissions in seconds; the average gap for StreamRhythm.Drip.
Returns
System.Single
MinInterval
Section titled “MinInterval”public float MinInterval { get; set; }Minimum interval for random rhythm.
Returns
System.Single
MaxInterval
Section titled “MaxInterval”public float MaxInterval { get; set; }Maximum interval for random rhythm.
Returns
System.Single
PointsPerEmission
Section titled “PointsPerEmission”public int PointsPerEmission { get; set; }Number of points to generate per emission. StreamRhythm.Drip always emits one.
Returns
System.Int32
CycleLength
Section titled “CycleLength”public int CycleLength { get; set; }Number of points in one cycle of MockStream.Pattern; emissions continue the pattern where the previous one ended.
Returns
System.Int32
BurstCount
Section titled “BurstCount”public int BurstCount { get; set; }Number of emissions per burst (for Burst rhythm).
Returns
System.Int32
BurstDelay
Section titled “BurstDelay”public float BurstDelay { get; set; }Delay between bursts.
Returns
System.Single
MinValue
Section titled “MinValue”public float MinValue { get; set; }Minimum value for generated data.
Returns
System.Single
MaxValue
Section titled “MaxValue”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
LabelPreset
Section titled “LabelPreset”public LabelPreset LabelPreset { get; set; }Label preset for generated data.
Returns
MockMagic.LabelPreset
CustomLabels
Section titled “CustomLabels”public string[] CustomLabels { get; set; }Labels cycled when MockStream.LabelPreset is LabelPreset.Custom.
Returns
System.String[]
DataLocaleId
Section titled “DataLocaleId”public string DataLocaleId { get; set; }Configured label locale. Changes take effect on the next start, or the next stopped manual emission.
Returns
System.String
ActiveLocale
Section titled “ActiveLocale”public MockLocale ActiveLocale { get; }Immutable locale captured by the active run, or null while stopped.
Returns
MockMagic.MockLocale
ActiveLocaleId
Section titled “ActiveLocaleId”public string ActiveLocaleId { get; }Locale identifier captured by the active run, or null while stopped.
Returns
System.String
IsRunning
Section titled “IsRunning”public bool IsRunning { get; }Whether the stream is currently running.
Returns
System.Boolean
ListenerCount
Section titled “ListenerCount”public int ListenerCount { get; }Gets the count of registered listeners.
Returns
System.Int32
Events
Section titled “Events”
OnDataEmitted
Section titled “OnDataEmitted”public event Action<MockDataPoint[]> OnDataEmittedEvent fired when new data points are generated.
Returns
System.Action{MockMagic.MockDataPoint[]}
OnStreamStarted
Section titled “OnStreamStarted”public event Action OnStreamStartedEvent fired when the stream starts.
Returns
System.Action
OnStreamStopped
Section titled “OnStreamStopped”public event Action OnStreamStoppedEvent fired when the stream stops.
Returns
System.Action