public Sprite getSprite(string sheetname, int index) { Spritesheet sheet = (from data in spritesheetList where data.sheetName == sheetname select data).FirstOrDefault(); if (sheet.sprites.Count > index) { return(sheet.sprites[index]); } return(null); }
private Spritesheet getSpritesheet(string sheetname, string filename) { Spritesheet retval = new Spritesheet(); retval.filename = filename; retval.sheetName = sheetname; Sprite[] spriteArray = Resources.LoadAll <Sprite>(filename); retval.sprites = spriteArray.ToList(); return(retval); }
private Spritesheet getSpritesheet(string sheetname, string filename) { Spritesheet retval = new Spritesheet(); retval.filename = filename; retval.sheetName = sheetname; Sprite[] spriteArray = Resources.LoadAll<Sprite>(filename); retval.sprites = spriteArray.ToList(); return retval; }