Exemple #1
0
        protected void ParseDataObjectAnimationSet()
        {
            string animName;
            ReadHeadOfDataObject(out animName);

            Animation anim = new Animation();
            scene.Anims.Add(anim);
            anim.Name = animName;

            bool running = true;
            while (running)
            {
                string objectName = GetNextToken();
                if (objectName.Length == 0)
                {
                    ThrowException("Unexpected end of file while parsing animation set.");
                }
                else if (objectName == "}")
                {
                    break; // animation set finished
                }
                else if (objectName == "Animation")
                {
                    ParseDataObjectAnimation(anim);
                }
                else
                {
                    Debug.WriteLine("Unknown data object in animation set in x file");
                    ParseUnknownDataObject();
                }
            }
        }
Exemple #2
0
        protected void ParseDataObjectAnimation(Animation pAnim)
        {
            ReadHeadOfDataObject();
            AnimBone banim = new AnimBone();
            pAnim.Anims.Add(banim);

            bool running = true;
            while (running)
            {
                string objectName = GetNextToken();
                if (objectName.Length == 0)
                {
                    ThrowException("Unexpected end of file while parsing animation.");
                }
                else if (objectName == "}")
                {
                    break; // animation finished
                }
                else if (objectName == "AnimationKey")
                {
                    ParseDataObjectAnimationKey(banim);
                }
                else if (objectName == "AnimationOptions")
                {
                    ParseUnknownDataObject(); // not interested
                }
                else if (objectName == "{")
                {
                    // read frame name
                    banim.BoneName = GetNextToken();
                    CheckForClosingBrace();
                }
                else
                {
                    Debug.WriteLine("Unknown data object in animation in x file");
                    ParseUnknownDataObject();
                }
            }
        }