1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 15:02:55 +08:00

Make sure icon is only instantiated once.

This commit is contained in:
smoogipooo 2017-03-24 15:43:17 +09:00
parent aa9a65d69c
commit eea24b2d82

View File

@ -18,11 +18,11 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
protected override Framework.Graphics.Drawable CreateIcon() protected override Framework.Graphics.Drawable CreateIcon()
{ {
return icon = new Sprite return icon ?? (icon = new Sprite
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
}; });
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]