mirror of
https://github.com/ppy/osu
synced 2025-02-09 22:57:37 +00:00
45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
|
// 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.Graphics;
|
||
|
using osu.Framework.Graphics.Containers;
|
||
|
using osu.Game.Rulesets.Objects.Drawables;
|
||
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||
|
|
||
|
namespace osu.Game.Rulesets.Osu.Skinning
|
||
|
{
|
||
|
public abstract class LegacySpinner : CompositeDrawable
|
||
|
{
|
||
|
protected DrawableSpinner DrawableSpinner { get; private set; }
|
||
|
|
||
|
[BackgroundDependencyLoader]
|
||
|
private void load(DrawableHitObject drawableHitObject)
|
||
|
{
|
||
|
RelativeSizeAxes = Axes.Both;
|
||
|
|
||
|
DrawableSpinner = (DrawableSpinner)drawableHitObject;
|
||
|
}
|
||
|
|
||
|
protected override void LoadComplete()
|
||
|
{
|
||
|
base.LoadComplete();
|
||
|
|
||
|
DrawableSpinner.ApplyCustomUpdateState += UpdateStateTransforms;
|
||
|
UpdateStateTransforms(DrawableSpinner, DrawableSpinner.State.Value);
|
||
|
}
|
||
|
|
||
|
protected virtual void UpdateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
protected override void Dispose(bool isDisposing)
|
||
|
{
|
||
|
base.Dispose(isDisposing);
|
||
|
|
||
|
if (DrawableSpinner != null)
|
||
|
DrawableSpinner.ApplyCustomUpdateState -= UpdateStateTransforms;
|
||
|
}
|
||
|
}
|
||
|
}
|