OpenMetaverse Protocol Library Developers API Documentation
AvatarAnimationEventArgs Class
NamespacesOpenMetaverseAvatarAnimationEventArgs
Provides data for the AvatarAnimationevent
Declaration Syntax
C#
public 
class 
AvatarAnimationEventArgs : 
EventArgs
Members
All Members Constructors Properties



Icon Member Description
AvatarAnimationEventArgs(UUID, List < (Of < <' ( Animation > ) > > ) )
Construct a new instance of the AvatarAnimationEventArgs class

Animations
Get the list of animations to start

AvatarID
Get the ID of the agent

Remarks
The AvatarAnimationevent occurs when the simulator sends the animation playlist for an agent
Examples
The following code example uses the AvatarIDand Animationsproperties to display the animation playlist of an avatar on the Consolewindow.
  Copy imageCopy
// subscribe to the event
Client.Avatars.AvatarAnimation += Avatars_AvatarAnimation;

private 
void
Avatars_AvatarAnimation(
object sender,
AvatarAnimationEventArgs e)
{
    
// create a dictionary of "known"
animations from the Animations class using System.Reflection
    Dictionary<UUID, 
string> systemAnimations
= 
new Dictionary<UUID, 
string>();
    Type type = 
typeof(Animations);
    System.Reflection.FieldInfo[] fields =
type.GetFields(System.Reflection.BindingFlags.Public |
System.Reflection.BindingFlags.Static);
    
foreach
(System.Reflection.FieldInfo field 
in fields)
    {
        systemAnimations.Add((UUID)field.GetValue(type),
field.Name);
    }

    
// find out which animations being
played are known animations and which are assets
    
foreach (Animation animation

in e.Animations)
    {
        
if
(systemAnimations.ContainsKey(animation.AnimationID))
        {
            Console.WriteLine(
"{0} is playing {1} ({2}) sequence
{3}", e.AvatarID,
                systemAnimations[animation.AnimationID],
animation.AnimationSequence);
        }
        
else
        {
            Console.WriteLine(
"{0} is playing {1} (Asset)
sequence {2}", e.AvatarID,
                animation.AnimationID,
animation.AnimationSequence);
        }
    }
}
Inheritance Hierarchy
Object
EventArgs
  AvatarAnimationEventArgs

Assembly: OpenMetaverse(Module: OpenMetaverse.dll) Version: 0.9.3.3318 (0.9.3.3318)