Exemple #1
0
        public static bool GenerateAtlas(Vector2[] sizes, int padding, int atlasSize, List <Rect> results)
        {
            bool flag = sizes == null;

            if (flag)
            {
                throw new ArgumentException("sizes array can not be null");
            }
            bool flag2 = results == null;

            if (flag2)
            {
                throw new ArgumentException("results list cannot be null");
            }
            bool flag3 = padding < 0;

            if (flag3)
            {
                throw new ArgumentException("padding can not be negative");
            }
            bool flag4 = atlasSize <= 0;

            if (flag4)
            {
                throw new ArgumentException("atlas size must be positive");
            }
            results.Clear();
            bool flag5 = sizes.Length == 0;
            bool result;

            if (flag5)
            {
                result = true;
            }
            else
            {
                NoAllocHelpers.EnsureListElemCount <Rect>(results, sizes.Length);
                Texture2D.GenerateAtlasImpl(sizes, padding, atlasSize, NoAllocHelpers.ExtractArrayFromListT <Rect>(results));
                result = (results.Count != 0);
            }
            return(result);
        }