1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-24 14:47:24 +08:00
osu-lazer/osu.Game.Rulesets.Catch/UI/HitExplosion.cs

43 lines
1.3 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Catch.Skinning.Default;
using osu.Game.Rulesets.Objects.Pooling;
using osu.Game.Skinning;
namespace osu.Game.Rulesets.Catch.UI
{
public class HitExplosion : PoolableDrawableWithLifetime<HitExplosionEntry>
{
[Cached]
private Bindable<HitExplosionEntry> bindableEntry { get; set; } = new Bindable<HitExplosionEntry>();
2020-12-01 10:32:20 +08:00
public HitExplosion()
{
RelativeSizeAxes = Axes.Both;
Anchor = Anchor.BottomCentre;
Origin = Anchor.BottomCentre;
}
[BackgroundDependencyLoader]
private void load()
{
InternalChild = new SkinnableDrawable(new CatchSkinComponent(CatchSkinComponents.HitExplosion), _ => new DefaultHitExplosion())
{
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre
};
}
protected override void OnApply(HitExplosionEntry entry)
{
base.OnApply(entry);
2020-12-01 10:32:20 +08:00
bindableEntry.Value = entry;
2020-12-01 10:32:20 +08:00
}
}
}