Astra Child

How to send a Signal

Estimated reading: 2 minutes 0 views

There are several ways of sending a signal, either from code or from the Signal Node. 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 Signal.Runtime.Signals;Code language: PHP (php)
Signal.Send(StreamCategory, StreamName, Message);Code language: CSS (css)
SignalsService.SendSignal(StreamCategory, StreamName, Message);Code language: CSS (css)
SignalStream.Get(StreamCategory, StreamName).SendSignal(Message);Code language: CSS (css)

Send a Signal on the stream with the given stream category and name, with a reference to the GameObject from where it is sent.

Simple Signal, with a GameObject reference

Send a Signal on the stream with the given stream category and name, with a reference to the GameObject from where it is sent

public string StreamCategory;   // Target stream category
public string StreamName;       // Target stream name
public GameObject SignalSource; // Reference to the GameObject from where this Signal is sent
public string Message;          // Text message used to pass info about this SignalCode language: PHP (php)
Signal.Send(StreamCategory, StreamName, SignalSource, Message);Code language: CSS (css)
SignalsService.SendSignal(StreamCategory, StreamName, SignalSource, Message);Code language: CSS (css)
SignalsService.Get(StreamCategory, StreamName).SendSignal(GameObject, Message);Code language: CSS (css)
Simple Signal, with a SignalProvider reference

Send a Signal on the stream with the given stream category and name, with a reference to the SignalProvider that sent it.

public string StreamCategory;         // Target stream category
public string StreamName;             // Target stream name
public SignalProvider SignalProvider; // Reference to the SignalProvider that sends this Signal
public string Message;                // Text message used to pass info about this SignalCode language: PHP (php)
Signal.Send(StreamCategory, StreamName, SignalProvider, Message);Code language: CSS (css)
SignalsService.SendSignal(StreamCategory, StreamName, SignalProvider, Message);Code language: CSS (css)
SignalStream.Get(StreamCategory, StreamName).SendSignal(SignalProvider, Message);Code language: CSS (css)
Simple Signal, with an Object reference

Send a Signal on the stream with the given stream category and name, with a reference to the Object that sent it.

public string StreamCategory; // Target stream category
public string StreamName;     // Target stream name
public Object SignalSender;   //Reference to the Object that sends this Signal
public string Message;        // Text message used to pass info about this SignalCode language: PHP (php)
Signal.Send(StreamCategory, StreamName, SignalSender, Message);Code language: CSS (css)
SignalsService.SendSignal(StreamCategory, StreamName, SignalSender, Message);Code language: CSS (css)
SignalStream.Get(StreamCategory, StreamName).SendSignal(SignalSender, Message);Code language: CSS (css)
Share this Doc
CONTENTS
Scroll to Top