OpenMetaverse.AgentManager.Animate C# (CSharp) Method

Animate() public method

Send an AgentAnimation packet that will toggle animations on or off
public Animate ( bool>.Dictionary animations, bool reliable ) : void
animations bool>.Dictionary A list of animation s, and whether to /// turn that animation on or off
reliable bool Whether to ensure delivery of this packet or not
return void
        public void Animate(Dictionary<UUID, bool> animations, bool reliable)
        {
            AgentAnimationPacket animate = new AgentAnimationPacket();
            animate.Header.Reliable = reliable;

            animate.AgentData.AgentID = Client.Self.AgentID;
            animate.AgentData.SessionID = Client.Self.SessionID;
            animate.AnimationList = new AgentAnimationPacket.AnimationListBlock[animations.Count];
            int i = 0;

            foreach (KeyValuePair<UUID, bool> animation in animations)
            {
                animate.AnimationList[i] = new AgentAnimationPacket.AnimationListBlock();
                animate.AnimationList[i].AnimID = animation.Key;
                animate.AnimationList[i].StartAnim = animation.Value;

                i++;
            }

            Client.Network.SendPacket(animate);
        }