AnimationComponent

 

 

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]
DefaultAnimation Animation . Gets the default scriptable animation.
[read-only]
IsValid bool . Whether or not this interface is valid. (Inherited from Sansar.Script.InstanceInterface.)
[read-only]
Name string . This AnimationComponent name, as specified in the editor.

Public Methods

  EnqueueEvent (int)
Enqueues an event for this component.
  EnqueueEvent (int, Sansar.Script.ScriptBase.OperationComplete) : ulong
Enqueues an event for this component.
  EnqueueEvent (int, Action<Sansar.Script.OperationCompleteEvent>)
Enqueues an event for this component.
  GetAnimation (string) : Animation
Finds a scriptable animations by name.
  GetAnimations () : IEnumerable<Animation>
Gets the scriptable animations for this object.
  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)
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>)
Asynchronously set the position for this object.
  Subscribe (string, AnimationComponent.SubscriptionHandler, bool)
Subscribes to Animation Events.
  Subscribe (string, Action<AnimationData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Animation Events.
override
ToString () : string
A string representation of this object.

 

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

DefaultAnimation Property

Gets the default scriptable animation.

Syntax

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

Value

An Animation object.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

EnqueueEvent Method

Enqueues an event for this component.

Syntax

[Sansar.Script.Interface]
public void 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 an event for this component.

Syntax

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
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 an event for this component.

Syntax

[Sansar.Script.Interface]
public void 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

GetAnimation Method

Finds a scriptable animations by name.

Syntax

[Sansar.Script.Interface]
public Animation GetAnimation (string animationName)

Parameters

animationName
The name of the animation.

Returns

An Animation, or null if no animation was found with the correct name.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

GetAnimations Method

Gets the scriptable animations for this object.

Syntax

[Sansar.Script.Interface]
public IEnumerable<Animation> GetAnimations ()

Returns

An IEnumarable collection of animation objects.

Remarks

Documentation for this section has not yet been entered.

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

Name Property

This AnimationComponent name, as specified in the editor.

Syntax

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

Value

Remarks

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 void SetPosition (Sansar.Vector position)

Parameters

position
The Mono.Simd.Vector4f position desired.

Returns

Returns an internal event id.

Remarks

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]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
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

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 void 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

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>", true)]
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 Sansar.Script.IEventSubscription Subscribe (string BehaviorName, Action<AnimationData> callback, bool persistent)

See Also

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.

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

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

 


 

 

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

0 Comments

Article is closed for comments.