예제 #1
0
 private float CalculateUsagePercentage(CachedSpriteGroup group)
 {
     if (mTotalFetches > 0)
     {
         return(group.Accesses / mTotalFetches);
     }
     else
     {
         return(0f);
     }
 }
예제 #2
0
        public Sprite FetchSprite(string assetName, int offset)
        {
            CachedSpriteGroup collection = this.FetchSpriteGroup(assetName);

            // Don't check for offset bounds explicitly.
            if (collection != null)
            {
                mTotalFetches++;
                return(collection.GetSprite(offset));
            }
            else
            {
                Debug.Log(String.Format("RuntimeSpriteCache: Unable to fetch sprite from asset: {0}, index: {1}", assetName, offset));
                return(null);
            }
        }