mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Set banana combo colour using random seed
This commit is contained in:
@ -3,11 +3,9 @@
|
||||
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Rulesets.Catch.UI;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Utils;
|
||||
|
||||
@ -23,10 +21,6 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
|
||||
protected override float SamplePlaybackPosition => HitObject.X / CatchPlayfield.WIDTH;
|
||||
|
||||
/// <summary>
|
||||
/// The seed value used for visual randomness such as fruit rotation.
|
||||
/// By default, <see cref="HitObject.StartTime"/> truncated to an integer is used.
|
||||
/// </summary>
|
||||
public Bindable<int> RandomSeed = new Bindable<int>();
|
||||
|
||||
protected DrawableCatchHitObject([CanBeNull] CatchHitObject hitObject)
|
||||
@ -35,15 +29,6 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
Anchor = Anchor.BottomLeft;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
StartTimeBindable.BindValueChanged(change =>
|
||||
{
|
||||
RandomSeed.Value = (int)change.NewValue;
|
||||
}, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a random number in range [0,1) based on seed <see cref="RandomSeed"/>.
|
||||
/// </summary>
|
||||
@ -54,6 +39,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
base.OnApply();
|
||||
|
||||
XBindable.BindTo(HitObject.XBindable);
|
||||
RandomSeed.BindTo(HitObject.RandomSeed);
|
||||
}
|
||||
|
||||
protected override void OnFree()
|
||||
@ -61,6 +47,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
base.OnFree();
|
||||
|
||||
XBindable.UnbindFrom(HitObject.XBindable);
|
||||
RandomSeed.UnbindFrom(HitObject.RandomSeed);
|
||||
}
|
||||
|
||||
public Func<CatchHitObject, bool> CheckPosition;
|
||||
|
Reference in New Issue
Block a user