Ejemplo n.º 1
0
        public override UILayout Cook(CookingContext context)
        {
            if (BitmapSheetSize.IsEmpty)
            {
                throw new InvalidOperationException("BitmapSheetSize is empty.");
            }
            if (string.IsNullOrEmpty(TextureOutput))
            {
                throw new InvalidOperationException("TextureOutput is null.");
            }
            if (TextureOutput.Contains("{0}") == false)
            {
                throw new InvalidOperationException("TextureOutput not exists {0}.");
            }
            if (string.IsNullOrEmpty(ImageOutput))
            {
                throw new InvalidOperationException("ImageOutput is null.");
            }
            if (ImageOutput.Contains("{0}") == false)
            {
                throw new InvalidOperationException("ImageOutput not exists {0}.");
            }

            UILayout input = Input.Cook(context);

            List <UIImage> images = new List <UIImage>();
            List <UILabel> labels = new List <UILabel>();

            CollectObjects(input.Root, images, labels);

            OptimizeAllImages(context, images);
            MergeAllImages(context, images);
            ExportAllMasks(context, images);

            return(input);
        }