ScriptHandle

Sansar.Script.ScriptHandle

ScriptHandle Class

A running script in Sansar.

Syntax

public class ScriptHandle

Remarks

This is a lightweight handle which is used by some API methods to refer to a script.

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

Members

See Also: Inherited members from object.

Public Properties

[read-only]
 
ID ScriptId . The Sansar Script's unique ID. This ID is unique among all scripts currently running in a scene. It will change every time the script or scene is started.
[read-only]
 
UnhandledExceptionRecoverable bool . If true a script can keep running if an unhandled exception is processed by ScriptHandle.UnhandledException.

Public Events

  UnhandledException Run by the script scheduler when the invocation of a script event handler or coroutine throws an exception.

Member Details

ID Property

The Sansar Script's unique ID. This ID is unique among all scripts currently running in a scene. It will change every time the script or scene is started.

Syntax

public ScriptId ID { get; }

Value

Returns ScriptId.Invalid if the ScriptHandle is not initialized with a valid script.

Remarks

Internal.

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

UnhandledException Event

Run by the script scheduler when the invocation of a script event handler or coroutine throws an exception.

Syntax

public event Action<object, Exception> UnhandledException

Remarks

If ScriptHandle.UnhandledExceptionRecoverable is true then the script may continue running if the handler does not throw an exception. If the handler needs to stop execution of the script it should throw the passed exception. The first argument is either the Sansar.Script.EventData that was being processed, or the Coroutine that was running when the exception occurred.

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

UnhandledExceptionRecoverable Property

If true a script can keep running if an unhandled exception is processed by ScriptHandle.UnhandledException.

Syntax

public bool UnhandledExceptionRecoverable { get; }

Value

Boolean indicating if the script may continue running after an unhandled exception occurs.

Remarks

If this is true and the ScriptHandle.UnhandledException event is set and does not throw and exception the script will continue to be scheduled.

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.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.