Use hit object pooling for Droplet and TinyDroplet.

This commit is contained in:
ekrctb
2020-11-30 19:04:09 +09:00
parent 05aaa377e7
commit 94fd607a7c
4 changed files with 23 additions and 8 deletions

View File

@ -1,6 +1,7 @@
// 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 JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Utils;
@ -13,7 +14,12 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
{
public override bool StaysOnPlate => false;
public DrawableDroplet(CatchHitObject h)
public DrawableDroplet()
: this(null)
{
}
public DrawableDroplet([CanBeNull] CatchHitObject h)
: base(h)
{
}

View File

@ -1,13 +1,20 @@
// 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 JetBrains.Annotations;
namespace osu.Game.Rulesets.Catch.Objects.Drawables
{
public class DrawableTinyDroplet : DrawableDroplet
{
protected override float ScaleFactor => base.ScaleFactor / 2;
public DrawableTinyDroplet(TinyDroplet h)
public DrawableTinyDroplet()
: this(null)
{
}
public DrawableTinyDroplet([CanBeNull] TinyDroplet h)
: base(h)
{
}