The Reactions class subscriptions to user reaction events.
public class Reactions : Sansar.Script.InstanceInterfaceMembers at a glance
| Kind | Members |
|---|---|
| Methods | AddReaction · AddSystemReaction · DisableDefaultReactions · RemoveReaction · SubscribeToReaction |
Methods
AddReaction
Added in 43.2.1
public void AddReaction(
string reactionType,
string displayText,
ThumbnailedClusterResource resource
)Add a new reaction type to all clients
| Parameter | Type | Description |
|---|---|---|
reactionType | string | A string that gets passed to the callback. Should be of a form like ‘Developer.Type’ to match the default, e.g. ‘Sansar.Fire’ |
displayText | string | A short string that appears on the emotes panel |
resource | ThumbnailedClusterResource | A cluster source which has a thumbnail defined in inventory. |
AddSystemReaction
Added in 43.2.1
public void AddSystemReaction(
string reactionType,
string displayText,
string thumbnailPath,
ClusterResource resource
)Add a new system default reaction. Intended for internal use by Sansar
| Parameter | Type | Description |
|---|---|---|
reactionType | string | A string that gets passed to the callback. Should be of a form like ‘Developer.Type’ to match the default, e.g. ‘Sansar.Fire’ |
displayText | string | A short string that appears on the emotes panel |
thumbnailPath | string | Must be a path to a file included by client. RUNTIME:/UI/Social/Images/*.png |
resource | ClusterResource | A cluster source that will be passed to the reaction callback. |
DisableDefaultReactions
Added in 43.2.1
public void DisableDefaultReactions()Removes all the default reactions from the emote menu, leaving only custom ones.
RemoveReaction
Added in 43.2.1
public void RemoveReaction(string reactionType)Remove the specified global reaction from all clients.
| Parameter | Type | Description |
|---|---|---|
reactionType | string | A string that gets passed to the callback. Should be of a form like ‘Developer.Type’ to match the default, e.g. ‘Sansar.Fire’ |
SubscribeToReaction
Added in 41.0.0
public Sansar.Script.IEventSubscription SubscribeToReaction(
Action<ReactionData> callback,
bool persistent
)Subscribes to Reaction Events.
| Parameter | Type | Description |
|---|---|---|
callback | Action<ReactionData> | Callback which is executed when the event completes. |
persistent | bool | Optional, set to false to unsubscribe after one event. |
Returns: Sansar.Script.IEventSubscription — An IEventSubscription that can be used to cancel the subscription.
Used in examples
Generated from the Sansar 47.10.0 client ScriptApi snapshot.