2019-01-24 16:43:03 +08:00
|
|
|
|
// 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.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2020-11-30 18:07:50 +08:00
|
|
|
|
using JetBrains.Annotations;
|
2016-11-14 17:03:20 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2020-12-03 11:13:14 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2020-12-07 11:35:24 +08:00
|
|
|
|
using osu.Game.Rulesets.Catch.Skinning.Default;
|
2020-02-17 17:47:22 +08:00
|
|
|
|
using osu.Game.Skinning;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2020-02-19 17:01:59 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
2016-10-13 09:10:15 +08:00
|
|
|
|
{
|
2021-06-07 13:49:37 +08:00
|
|
|
|
public class DrawableFruit : DrawablePalpableCatchHitObject
|
2016-10-13 09:10:15 +08:00
|
|
|
|
{
|
2020-11-30 18:07:50 +08:00
|
|
|
|
public DrawableFruit()
|
|
|
|
|
: this(null)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DrawableFruit([CanBeNull] Fruit h)
|
2017-08-08 11:46:37 +08:00
|
|
|
|
: base(h)
|
2016-10-13 09:10:15 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2016-11-12 18:44:16 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
2017-08-02 18:37:20 +08:00
|
|
|
|
private void load()
|
|
|
|
|
{
|
2020-12-10 18:42:01 +08:00
|
|
|
|
ScalingContainer.Child = new SkinnableDrawable(
|
2020-12-07 13:08:50 +08:00
|
|
|
|
new CatchSkinComponent(CatchSkinComponents.Fruit),
|
2020-12-10 18:42:01 +08:00
|
|
|
|
_ => new FruitPiece());
|
2020-11-27 09:10:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-12-07 11:59:03 +08:00
|
|
|
|
protected override void UpdateInitialTransforms()
|
2018-01-03 17:26:54 +08:00
|
|
|
|
{
|
2020-12-07 11:59:03 +08:00
|
|
|
|
base.UpdateInitialTransforms();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2020-12-10 18:42:01 +08:00
|
|
|
|
ScalingContainer.RotateTo((RandomSingle(1) - 0.5f) * 40);
|
2017-12-31 21:09:07 +08:00
|
|
|
|
}
|
2016-10-13 09:10:15 +08:00
|
|
|
|
}
|
|
|
|
|
}
|