Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Sprite GetSprite(string code, bool? tryGedSD = null)
- {
- bool hasTag = code.EndsWith(HDTag);
- if(tryGedSD.HasValue == false)
- {
- tryGedSD = hasTag;
- }
- if(tryGedSD.Value && isSlowDeviceCahed && hasTag)
- {
- string sdName = code.Replace(HDTag,SDTag);
- if(spriteIndex_.ContainsKey(sdName))
- return spriteIndex_[sdName];
- else
- Log.Error("Sprite {0} is not supporting HD/SD! Yet _hd tag is provided",sdName);
- }
- if(spriteIndex_.ContainsKey(code))
- return spriteIndex_[code];
- throw new KeyNotFoundException(string.Format("Sprite named {0} not found, maybe you need to repack sprites", code));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement