Skip to content

Get Sansar

Script API

Reactions

Where: Client
More page actions

For the complete documentation index, see llms.txt. This page is also available as Markdown.

Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 41.0.0

The Reactions class subscriptions to user reaction events.

public class Reactions : Sansar.Script.InstanceInterface

Members at a glance

KindMembers
MethodsAddReaction · 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

ParameterTypeDescription
reactionTypestringA string that gets passed to the callback. Should be of a form like ‘Developer.Type’ to match the default, e.g. ‘Sansar.Fire’
displayTextstringA short string that appears on the emotes panel
resourceThumbnailedClusterResourceA 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

ParameterTypeDescription
reactionTypestringA string that gets passed to the callback. Should be of a form like ‘Developer.Type’ to match the default, e.g. ‘Sansar.Fire’
displayTextstringA short string that appears on the emotes panel
thumbnailPathstringMust be a path to a file included by client. RUNTIME:/UI/Social/Images/*.png
resourceClusterResourceA 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.

ParameterTypeDescription
reactionTypestringA 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.

ParameterTypeDescription
callbackAction<ReactionData>Callback which is executed when the event completes.
persistentboolOptional, 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.