public bool hasSpriteParts(SpriteParts.Part[] parts) { if (Parts == null) return false; foreach (SpriteParts.Part p in parts) { if (!Parts.ContainsKey(p)) return false; } return true; }
public Sprite loadSpriteParts(SpriteParts.Part[] parts, int frameCount=0, int frameTime=0) { if (content == null) throw new ArgumentNullException("This sprite can not load parts (Content is null)"); this.frameTime = frameTime; this.frameCount = frameCount; Parts = new Dictionary<SpriteParts.Part, Texture2D>(parts.Length); foreach (SpriteParts.Part p in parts) { Parts.Add(p, content.Load<Texture2D>(baseName + "/" + baseName + "_" + p.ToString())); } return this; }
public Texture2D getSpritePart(SpriteParts.Part part) { return Parts[part]; }