Add GetTexture method to ISkinSource

Used to shortcut lookup checks without potentially expensive drawable creation overhead.
This commit is contained in:
Dean Herbert
2018-03-20 16:28:39 +09:00
parent 9ad4e9284a
commit f03abb3145
6 changed files with 18 additions and 1 deletions

View File

@ -57,12 +57,14 @@ namespace osu.Game.Skinning
break;
}
var texture = Textures.Get(componentName);
var texture = GetTexture(componentName);
if (texture == null) return null;
return new Sprite { Texture = texture };
}
public override Texture GetTexture(string componentName) => Textures.Get(componentName);
public override SampleChannel GetSample(string sampleName) => Samples.Get(sampleName);
protected class LegacySkinResourceStore<T> : IResourceStore<byte[]>