コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: AssetLibrary.cs プロジェクト: mengtest/UnityRPG
        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;
 
        }