예제 #1
0
        public static AnimationDescriptor Load(string filePath)
        {
            AnimationDescriptor animationDescription = new AnimationDescriptor();

            using (FileStream fileStream = File.Open(filePath, FileMode.Open))
            {
                using (BinaryReader binaryReader = new BinaryReader(fileStream))
                {
                    animationDescription.Name = binaryReader.ReadString();
                    animationDescription.SubSurfaceAnimation.FrameWidth  = binaryReader.ReadInt32();
                    animationDescription.SubSurfaceAnimation.FrameHeight = binaryReader.ReadInt32();
                    animationDescription.SubSurfaceAnimation.FrameTime   = binaryReader.ReadInt32();
                    animationDescription.SubSurfaceAnimation.LoopCount   = binaryReader.ReadInt32();
                    animationDescription.SubSurfaceAnimation.TexturePath = binaryReader.ReadString();

                    animationDescription.SurfaceAnimation.FrameWidth  = binaryReader.ReadInt32();
                    animationDescription.SurfaceAnimation.FrameHeight = binaryReader.ReadInt32();
                    animationDescription.SurfaceAnimation.FrameTime   = binaryReader.ReadInt32();
                    animationDescription.SurfaceAnimation.LoopCount   = binaryReader.ReadInt32();
                    animationDescription.SurfaceAnimation.TexturePath = binaryReader.ReadString();
                }
            }

            return(animationDescription);
        }
예제 #2
0
        public static AnimationDescriptor Create()
        {
            AnimationDescriptor desc = new AnimationDescriptor();

            desc.SubSurfaceAnimation.TexturePath = "";
            desc.SurfaceAnimation.TexturePath    = "";

            return(desc);
        }