Example #1
0
        public void AnimationDone(bool success)
        {
            var node = PendingAnimations.First;

            if (node != null)
            {
                AnimationCounter++;
                do
                {
                    var entry = node.Value;

                    if (entry.NumAnims > AnimationCounter)
                    {
                        break;
                    }

                    if ((entry.Motion & (uint)CommandMask.Action) != 0)
                    {
                        State.remove_action_head();
                    }

                    var motionID = entry.Motion;
                    PhysicsObj.MotionDone(motionID, success);
                    AnimationCounter -= entry.NumAnims;

                    if (PendingAnimations.First != null)
                    {
                        PendingAnimations.RemoveFirst();
                    }

                    if (PhysicsObj.WeenieObj != null)
                    {
                        PhysicsObj.WeenieObj.OnMotionDone(motionID, success);
                    }

                    node = PendingAnimations.First;
                }while (node != null);

                if (AnimationCounter != 0 && node == null)
                {
                    AnimationCounter = 0;
                }
            }
        }
Example #2
0
        public void AnimationDone(bool success)
        {
            var node = PendingAnimations.FirstOrDefault();

            while (node != null)
            {
                AnimationCounter++;
                do
                {
                    if (node.NumAnims > AnimationCounter)
                    {
                        break;
                    }

                    if ((node.Motion & 0x10000000) != 0)
                    {
                        State.remove_action_head();
                    }

                    var motionID = node.Motion;
                    PhysicsObj.MotionDone(motionID, success);
                    AnimationCounter -= node.NumAnims;

                    if (PendingAnimations.Count > 0)
                    {
                        PendingAnimations.RemoveAt(0);
                    }

                    if (PhysicsObj.WeenieObj != null)
                    {
                        PhysicsObj.WeenieObj.OnMotionDone(motionID, success);
                    }

                    node = PendingAnimations.FirstOrDefault();
                }while (node != null);

                if (AnimationCounter != 0 && node == null)
                {
                    AnimationCounter = 0;
                }
            }
        }