private float CalculateUsagePercentage(CachedSpriteGroup group) { if (mTotalFetches > 0) { return(group.Accesses / mTotalFetches); } else { return(0f); } }
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); } }