Use common skinnable catcher in catcher trails

This commit is contained in:
ekrctb 2021-06-14 19:45:58 +09:00
parent ca061c4b93
commit 9b6ab4360e
2 changed files with 7 additions and 15 deletions

View File

@ -120,8 +120,8 @@ namespace osu.Game.Rulesets.Catch.UI
{
CatcherTrailSprite sprite = trailPool.Get();
sprite.Texture = catcher.CurrentTexture;
sprite.Anchor = catcher.Anchor;
sprite.AnimationState = catcher.CurrentState;
sprite.Origin = catcher.Origin;
sprite.Scale = catcher.Scale;
sprite.Blending = BlendingParameters.Additive;
sprite.RelativePositionAxes = catcher.RelativePositionAxes;

View File

@ -3,32 +3,24 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Pooling;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osuTK;
namespace osu.Game.Rulesets.Catch.UI
{
public class CatcherTrailSprite : PoolableDrawable
{
public Texture Texture
public CatcherAnimationState AnimationState
{
set => sprite.Texture = value;
set => body.AnimationState.Value = value;
}
private readonly Sprite sprite;
private readonly SkinnableCatcher body;
public CatcherTrailSprite()
{
InternalChild = sprite = new Sprite
{
RelativeSizeAxes = Axes.Both
};
Size = new Vector2(CatcherArea.CATCHER_SIZE);
// Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling.
OriginPosition = new Vector2(0.5f, 0.06f) * CatcherArea.CATCHER_SIZE;
Origin = Anchor.TopCentre;
InternalChild = body = new SkinnableCatcher();
}
protected override void FreeAfterUse()