Avoid unnecessary texture retrieval for non-animated sprites

This commit is contained in:
Dean Herbert 2019-08-19 17:47:59 +09:00
parent d224405bc6
commit d02b8d14f7
1 changed files with 2 additions and 2 deletions

View File

@ -142,9 +142,9 @@ public override Drawable GetDrawableComponent(string componentName)
};
}
var texture = GetTexture($"{componentName}-0");
Texture texture;
if (texture != null && animatable)
if (animatable && (texture = GetTexture($"{componentName}-0")) != null)
{
var animation = new TextureAnimation { DefaultFrameLength = default_frame_time };