AnimationComponent.SubscriptionHandler

AnimationComponent Class

The AnimationComponent handles interactions with animations.

Syntax

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

Remarks

Animated objects should be manipulated through this interface.

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 Fields

static readonly
ComponentType ComponentType . The AnimationComponent.ComponentType of this component

Public Properties

[read-only]
 
ComponentId Sansar.Script.ComponentId . Retrieves the component id for this AnimationComponent.
[read-only]
 
IsValid bool . Whether or not this interface is valid. (Inherited from Sansar.Script.InstanceInterface.)

Public Methods

 
EnqueueEvent (int) : ulong
Enqueues and event for this component.
 
EnqueueEvent (int, Sansar.Script.ScriptBase.OperationComplete) : ulong
Enqueues and event for this component.
 
EnqueueEvent (int, Action<Sansar.Script.OperationCompleteEvent>) : ulong
Enqueues and event for this component.
 
GetEventId (string) : int
Lookup the event id for the named event.
 
GetVectorAnimationVariable (string) : Sansar.Vector
Get a Vector type variable from the animation by name
 
HasEvent (string) : bool
Check this component for the existence of the named event.
 
SetPosition (Sansar.Vector) : ulong
Asynchronously set the position for this object.
 
SetPosition (Sansar.Vector, Sansar.Script.ScriptBase.OperationComplete) : ulong
Asynchronously set the position for this object.
 
SetPosition (Sansar.Vector, Action<Sansar.Script.OperationCompleteEvent>) : ulong
Asynchronously set the position for this object.
 
Subscribe (string, AnimationComponent.SubscriptionHandler, bool)
Subscribes to Animation Events.
 
Subscribe (string, Action<AnimationData>, bool)
Subscribes to Animation Events.
override
ToString () : string
A string representation of this object.
 
UnsubscribeFromEvent (string)
Unubscribes from the named event.

Member Details

ComponentId Property

Retrieves the component id for this AnimationComponent.

Syntax

[get: Sansar.Script.Interface]
public Sansar.Script.ComponentId ComponentId { get; }

Value

The id.

Remarks

This id will be unique among all components.

Requirements

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

ComponentType Field

The AnimationComponent.ComponentType of this component

Syntax

public static readonly ComponentType ComponentType

Remarks

 

Requirements

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

EnqueueEvent Method

Enqueues and event for this component.

Syntax

[Sansar.Script.Interface]
public ulong EnqueueEvent (int internalId)

Parameters

internalId
The id of the animation event, may be looked up by name from AnimationComponent.GetEventId(string)

Returns

The internal event id for the completion event.

Remarks

Ids can be retrieved with AnimationComponent.GetEventId(string).

Requirements

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

EnqueueEvent Method

Enqueues and event for this component.

Syntax

[Sansar.Script.Interface]
public ulong EnqueueEvent (int internalId, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

internalId
The id of the animation event, may be looked up by name from AnimationComponent.GetEventId(string)
handler
Handler to be called when the event completes.

Returns

The internal event id for the completion event.

Remarks

Ids can be retrieved with AnimationComponent.GetEventId(string).

Requirements

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

EnqueueEvent Method

Enqueues and event for this component.

Syntax

[Sansar.Script.Interface]
public ulong EnqueueEvent (int internalId, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

internalId
The id of the animation event, may be looked up by name from AnimationComponent.GetEventId(string)
handler
Handler to be called when the event completes.

Returns

The internal event id for the completion event.

Remarks

Ids can be retrieved with AnimationComponent.GetEventId(string).

Requirements

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

GetEventId Method

Lookup the event id for the named event.

Syntax

[Sansar.Script.Interface]
public int GetEventId (string eventName)

Parameters

eventName
The name of the event to query.

Returns

The id of the named event or -1 if the name is not valid.

Remarks

This can be used to trigger animations with AnimationComponent.EnqueueEvent(int).

Requirements

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

GetVectorAnimationVariable Method

Get a Vector type variable from the animation by name

Syntax

[Sansar.Script.Interface]
public Sansar.Vector GetVectorAnimationVariable (string variableName)

Parameters

variableName
The name of the animation variable

Returns

A Mono.Simd.Vector4f of the value of the named variable

Exceptions

Type Reason
ArgumentException Thrown when attempting to get a variable that doesn't exist or is of the wrong type
ArgumentNullException If variableName is null

Remarks

Characters have an 'LLCameraForward' variable which can be queried with GetVectorAnimationVariable to determine the forward vector of the camera.

Requirements

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

HasEvent Method

Check this component for the existence of the named event.

Syntax

[Sansar.Script.Interface]
public bool HasEvent (string eventName)

Parameters

eventName
The name of the event to query.

Returns

true if the event exits.

Remarks

Can be used to check if an event exists.

Requirements

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

SetPosition Method

Asynchronously set the position for this object.

Syntax

[Sansar.Script.Interface]
public ulong SetPosition (Sansar.Vector position)

Parameters

position
The Mono.Simd.Vector4f position desired.

Returns

Returns an internal event id.

Remarks

To block until the method returns pass this to Sansar.Script.ScriptBase.WaitFor(Action<Action<Sansar.Script.EventData>,System.Boolean>) in a coroutine.

Requirements

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

SetPosition Method

Asynchronously set the position for this object.

Syntax

[Sansar.Script.Interface]
public ulong SetPosition (Sansar.Vector position, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

position
The Mono.Simd.Vector4f position desired.
handler
Handler to be called when the event completes.

Returns

Returns an internal event id.

Remarks

To block until the method returns pass this to Sansar.Script.ScriptBase.WaitFor(Action<Action<Sansar.Script.EventData>,System.Boolean>) in a coroutine.

Requirements

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

SetPosition Method

Asynchronously set the position for this object.

Syntax

[Sansar.Script.Interface]
public ulong SetPosition (Sansar.Vector position, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

position
The Mono.Simd.Vector4f position desired.
handler
Handler to be called when the event completes.

Returns

Returns an internal event id.

Remarks

To block until the method returns pass this to Sansar.Script.ScriptBase.WaitFor(Action<Action<Sansar.Script.EventData>,System.Boolean>) in a coroutine.

Requirements

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

Subscribe Method

Subscribes to Animation Events.

Syntax

[Sansar.Script.Interface]
[System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.AnimationData>", false)]
public void Subscribe (string BehaviorName, AnimationComponent.SubscriptionHandler callback, bool persistent)

Parameters

BehaviorName
The behavior name of the Animation. This name will match the subscribed event.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.

Remarks

 

Requirements

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

Subscribe Method

Subscribes to Animation Events.

Syntax

[Sansar.Script.Interface]
public void Subscribe (string BehaviorName, Action<AnimationData> callback, bool persistent)

Parameters

BehaviorName
The behavior name of the Animation. This name will match the subscribed event.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.

Remarks

 

Requirements

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

ToString Method

A string representation of this object.

Syntax

[Sansar.Script.Interface]
public override string ToString ()

Returns

A string representation of this object.

Remarks

The format of this string may change between releases.

Requirements

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

UnsubscribeFromEvent Method

Unubscribes from the named event.

Syntax

[Sansar.Script.Interface]
public void UnsubscribeFromEvent (string name)

Parameters

name
The name of the animation event to stop monitoring.

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.