Ruyi SDK
Namespaces
Ruyi.Layer0
SubscribeClient Class
SubscribeClient Methods
Click or drag to resizeClick or drag to resize

SubscribeClient Class

[This is preliminary documentation and is subject to change.]

Client to subscribe to publishers.
Inheritance Hierarchy
SystemObject
  Ruyi.Layer0SubscribeClient

Namespace:  Ruyi.Layer0
Assembly:  SDK.Base.nf2.0 (in SDK.Base.nf2.0.dll) Version: 0.9.3.3995 (0.9.3.3995)
Syntax
C#
Copy
public class SubscribeClient : IDisposable

The SubscribeClient type exposes the following members.

Methods
  NameDescription
Public methodAddGenericMessageHandler
Adds the generic message handler.
Public methodAddMessageHandlerT
Adds a message handler.
Public methodStatic memberCreateInstance
Creates SubscribeClient instance.
Public methodDispose
Releases all resources used by the SubscribeClient
Public methodRemoveGenericMessageHandler
Removes the generic message handler.
Public methodRemoveMessageHandlerT
Removes a message handler.
Public methodSubscribe
Subscribes to the specified topic.
Public methodUnsubscribe
Unsubscribes from the specified topic.
Top
Examples
Getting gamepad/controler input:
Copy
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!
    }
});
See Also

Reference

Ruyi.Layer0 Namespace

Copyright ©Zhongshan Subor Advanced Technology Co., Ltd. 2017-2018, All right reserved

Send comments on this topic to dev-support@playruyi.com