public static bool GenerateAtlas(Vector2[] sizes, int padding, int atlasSize, List <Rect> results) { if (sizes == null) { throw new ArgumentException("sizes array can not be null"); } if (results == null) { throw new ArgumentException("results list cannot be null"); } if (padding < 0) { throw new ArgumentException("padding can not be negative"); } if (atlasSize <= 0) { throw new ArgumentException("atlas size must be positive"); } results.Clear(); bool result; if (sizes.Length == 0) { result = true; } else { Texture2D.GenerateAtlasInternal(sizes, padding, atlasSize, results); result = (results.Count != 0); } return(result); }