Interaction

Interaction Class

 

Syntax

[Sansar.Script.Interface]
public class Interaction : Sansar.Script.InstanceInterface

Remarks

 

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Members

See Also: Inherited members from Sansar.Script.InstanceInterface.

Public Properties

[read-only]
 
IsValid bool . Whether or not this interface is valid. (Inherited from Sansar.Script.InstanceInterface.)

Public Methods

 
GetEnabled () : bool
Returns true if the interaction is enabled.
 
GetPrompt () : string
Get the current Interaction prompt.
 
SetEnabled (bool)
Change an Interaction state to disabled or enabled.
 
SetEnabled (boolSansar.Script.ScriptBase.OperationComplete) : ulong
Change an Interaction state to disabled or enabled.
 
SetEnabled (boolAction<Sansar.Script.OperationCompleteEvent>)
Change an Interaction state to disabled or enabled.
 
SetPrompt (string)
Set the Interaction prompt string.
 
SetPrompt (stringSansar.Script.ScriptBase.OperationComplete) : ulong
Set the Interaction prompt string.
 
SetPrompt (stringAction<Sansar.Script.OperationCompleteEvent>)
Set the Interaction prompt string.
 
Subscribe (Action<InteractionData>bool) : Sansar.Script.IEventSubscription
Subscribes to Interaction Events.

Member Details

GetEnabled Method

Returns true if the interaction is enabled.

Syntax

[Sansar.Script.Interface]
public bool GetEnabled ()

Returns

true if the interaction is enabled.

Remarks

Disabled interactions do not highlight, do not show their prompt and cannot be 'clicked'.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetPrompt Method

Get the current Interaction prompt.

Syntax

[Sansar.Script.Interface]
public string GetPrompt ()

Returns

The current prompt string.

Remarks

The prompt text shows when hovering over the object the script is on.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetEnabled Method

Change an Interaction state to disabled or enabled.

Syntax

[Sansar.Script.Interface]
public void SetEnabled (bool value)

Parameters

value
true to enable the Interaction, false to disable it.

Remarks

All Interactions start off enabled. Disabled interactions do not highlight, do not show their prompt and cannot be 'clicked'.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetEnabled Method

Change an Interaction state to disabled or enabled.

Syntax

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetEnabled (bool value, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

value
true to enable the Interaction, false to disable it.
handler
Handler to be called when the event completes.

Returns

A legacy eventId

Remarks

All Interactions start off enabled. Disabled interactions do not highlight, do not show their prompt and cannot be 'clicked'.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetEnabled Method

Change an Interaction state to disabled or enabled.

Syntax

[Sansar.Script.Interface]
public void SetEnabled (bool value, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

value
true to enable the Interaction, false to disable it.
handler
Handler to be called when the event completes.

Remarks

All Interactions start off enabled. Disabled interactions do not highlight, do not show their prompt and cannot be 'clicked'.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetPrompt Method

Set the Interaction prompt string.

Syntax

[Sansar.Script.Interface]
public void SetPrompt (string prompt)

Parameters

prompt
The string to set the prompt to.

Remarks

The prompt text shows when hovering over the object the script is on. The prompt must be 128 characters or less and 4 lines or less. Use Sansar.Script.DefaultValueAttribute to set a default prompt.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetPrompt Method

Set the Interaction prompt string.

Syntax

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetPrompt (string prompt, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

prompt
The string to set the prompt to.
handler
Handler to be called when the event completes.

Returns

A legacy eventId

Remarks

The prompt text shows when hovering over the object the script is on. The prompt must be 128 characters or less and 4 lines or less. Use Sansar.Script.DefaultValueAttribute to set a default prompt.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetPrompt Method

Set the Interaction prompt string.

Syntax

[Sansar.Script.Interface]
public void SetPrompt (string prompt, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

prompt
The string to set the prompt to.
handler
Handler to be called when the event completes.

Remarks

The prompt text shows when hovering over the object the script is on. The prompt must be 128 characters or less and 4 lines or less. Use Sansar.Script.DefaultValueAttribute to set a default prompt.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Subscribe Method

Subscribes to Interaction Events.

Syntax

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (Action<InteractionData> callback, bool persistent)

See Also

Parameters

callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.

Returns

An Sansar.Script.IEventSubscription that can be used to cancel the subscription.

Remarks

 

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.