コード例 #1
0
        /// <summary>
        ///     The movement animation is reserved for "main" animations
        ///     that are mutually exclusive, e.g. flying and sitting.
        /// </summary>
        public void TrySetMovementAnimation(string anim, bool sendTerseUpdateIfNotSending)
        {
            //MainConsole.Instance.DebugFormat("Updating movement animation to {0}", anim);

            if (!m_useSplatAnimation && anim == "STANDUP")
            {
                anim = "LAND";
            }

            if (!m_scenePresence.IsChildAgent)
            {
                if (m_animations.TrySetDefaultAnimation(
                        anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID))
                {
                    // 16384 is CHANGED_ANIMATION
                    IAttachmentsModule attMod = m_scenePresence.Scene.RequestModuleInterface <IAttachmentsModule>();
                    if (attMod != null)
                    {
                        attMod.SendScriptEventToAttachments(m_scenePresence.UUID, "changed",
                                                            new Object[] { (int)Changed.ANIMATION });
                    }
                    SendAnimPack();
                }
                else if (sendTerseUpdateIfNotSending)
                {
                    m_scenePresence.SendTerseUpdateToAllClients(); //Send the terse update alone then
                }
            }
        }
コード例 #2
0
ファイル: Animator.cs プロジェクト: satlanski2/Aurora-Sim
        /// <summary>
        ///   Update the movement animation of this avatar according to its current state
        /// </summary>
        public void UpdateMovementAnimations(bool sendTerseUpdate)
        {
            string oldanimation = m_movementAnimation;

            m_movementAnimation = GetMovementAnimation();
            if (oldanimation != m_movementAnimation)
            {
                TrySetMovementAnimation(m_movementAnimation);
            }
            else if (sendTerseUpdate)
            {
                m_scenePresence.SendTerseUpdateToAllClients(); //Send the terse update alone then
            }
        }