![]() | SubscribeClient Class |
[This is preliminary documentation and is subject to change.]
Namespace: Ruyi.Layer0
public class SubscribeClient : IDisposable
The SubscribeClient type exposes the following members.
Name | Description | |
---|---|---|
![]() | AddGenericMessageHandler |
Adds the generic message handler.
|
![]() | AddMessageHandlerT |
Adds a message handler.
|
![]() ![]() | CreateInstance |
Creates SubscribeClient instance.
|
![]() | Dispose | Releases all resources used by the SubscribeClient |
![]() | RemoveGenericMessageHandler |
Removes the generic message handler.
|
![]() | RemoveMessageHandlerT |
Removes a message handler.
|
![]() | Subscribe |
Subscribes to the specified topic.
|
![]() | Unsubscribe |
Unsubscribes from the specified topic.
|
var sdk = RuyiSDK.CreateInstance(new RuyiSDKContext { endpoint = RuyiSDKContext.Endpoint.Console, EnabledFeatures = RuyiSDK.SDKFeatures.Basic }); sdk.Subscriber.Subscribe(Ruyi.Layer0.ServiceHelper.PubChannelID(Ruyi.Layer0.ServiceIDs.INPUTMANAGER_INTERNAL)); sdk.Subscriber.AddMessageHandler<Ruyi.SDK.InputManager.RuyiGamePadInput>((topic, message) => { if ((message.ButtonFlags & (int)Ruyi.SDK.CommonType.RuyiGamePadButtonFlags.GamePad_A) != 0) { // "A" pressed! } });