public static void GenerateSnapshot(BackgroundGroup group) { if (group == null || group.entries.Count <= 0) { return; } GenerateSnapshot(group.entries[0]); }
private static bool GroupResourcesReferenceIsCorrect(BackgroundGroup group) { foreach (var entry in group.entries) { var path = entry.resourcePath; if (Resources.Load <Sprite>(path) == null) { return(false); } } return(true); }
private static bool GroupSnapshotAspectRatioIsCorrect(BackgroundGroup group) { if (group.entries.Count == 0) { return(true); } var entry = group.entries[0]; var path = entry.resourcePath; var sprite = Resources.Load <Sprite>(path); if (sprite == null) { return(true); } var tex = sprite.texture; var size = entry.snapshotScale * new Vector2(tex.width, tex.height); return(Math.Abs(BackgroundGroupEditor.SnapshotAspectRatio - size.y / size.x) < 3 * float.Epsilon); }
private static bool GroupIsEmpty(BackgroundGroup group) { return(group.entries.Count == 0); }