Astra Child

How to send a MetaSignal

Estimated reading: 2 minutes 0 views

There are several ways of sending a meta signal, either from code or from the Signal Node. A meta signal can be sent with any value or reference payload of type . Below are some examples on how to do that.

Send from code

using Doozy.Runtime.Signals;Code language: CSS (css)
Simple Signal (a ping)

Send a Signal on the stream with the given stream category and name.

public string StreamCategory; // Target stream category
public string StreamName;     // Target stream name
public string Message;        // Text message used to pass info about this SignalCode language: PHP (php)
Send a bool value
public bool BoolValue = true; // Boolean valueCode language: PHP (php)
Signal.Send(StreamCategory, StreamName, BoolValue, Message);Code language: CSS (css)
SignalsService.SendSignal(StreamCategory, StreamName, BoolValue, Message);Code language: CSS (css)
SignalStream.Get(StreamCategory, StreamName).SendSignal(BoolValue, Message);Code language: CSS (css)
Send an integer value
public int IntValue = 42; // Integer valueCode language: PHP (php)
Signal.Send(StreamCategory, StreamName, IntValue, Message);Code language: CSS (css)
SignalsService.SendSignal(StreamCategory, StreamName, IntValue, Message);Code language: CSS (css)
SignalStream.Get(StreamCategory, StreamName).SendSignal(IntValue, Message);Code language: CSS (css)
Send a float value
public float FloatValue = 0.42f; // Float valueCode language: PHP (php)
Signal.Send(StreamCategory, StreamName, FloatValue, Message);Code language: CSS (css)
SignalsService.SendSignal(StreamCategory, StreamName, FloatValue, Message);Code language: CSS (css)
SignalStream.Get(StreamCategory, StreamName).SendSignal(FloatValue, Message);Code language: CSS (css)
Send a Color value
public Color ColorValue = Color.magenta; // Color valueCode language: PHP (php)
Signal.Send(StreamCategory, StreamName, ColorValue, Message);Code language: CSS (css)
Signal.Send(StreamCategory, StreamName, ColorValue, Message);Code language: CSS (css)
SignalStream.Get(StreamCategory, StreamName).SendSignal(ColorValue, Message);Code language: CSS (css)
Send a custom data class value
[Serializable]
public class MyDataClass // Custom data class
{
    public MyDataClass(string someString, GameObject someReference, Vector2 someVector2)
    {
        SomeString = someString;
        SomeReference = someReference;
        SomeVector2 = someVector2;
    }
    public string SomeString;
    public GameObject SomeReference;
    public Vector2 SomeVector2;
}Code language: PHP (php)
MyDataClass myData = new MyDataClass("A String", null, Vector2.one);Code language: JavaScript (javascript)
Signal.Send(StreamCategory, StreamName, myData, Message);Code language: CSS (css)
SignalsService.SendSignal(StreamCategory, StreamName, myData, Message);Code language: CSS (css)
SignalStream.Get(StreamCategory, StreamName).SendSignal(myData, Message);Code language: CSS (css)
Share this Doc
CONTENTS
Scroll to Top