mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:52:55 +08:00
Add name identifying container and rename index variable
This commit is contained in:
parent
7f015ee1d0
commit
bf44c09a91
@ -73,6 +73,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
background,
|
background,
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
|
Name = "Column samples pool",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
ChildrenEnumerable = hitSounds = Enumerable.Range(0, max_concurrent_hitsounds).Select(_ => new SkinnableSound()).ToArray()
|
ChildrenEnumerable = hitSounds = Enumerable.Range(0, max_concurrent_hitsounds).Select(_ => new SkinnableSound()).ToArray()
|
||||||
},
|
},
|
||||||
@ -132,7 +133,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
HitObjectArea.Explosions.Add(hitExplosionPool.Get(e => e.Apply(result)));
|
HitObjectArea.Explosions.Add(hitExplosionPool.Get(e => e.Apply(result)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private int nextHitSound;
|
private int nextHitSoundIndex;
|
||||||
|
|
||||||
public bool OnPressed(ManiaAction action)
|
public bool OnPressed(ManiaAction action)
|
||||||
{
|
{
|
||||||
@ -147,12 +148,12 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
if (nextObject is DrawableManiaHitObject maniaObject)
|
if (nextObject is DrawableManiaHitObject maniaObject)
|
||||||
{
|
{
|
||||||
var hitSound = hitSounds[nextHitSound];
|
var hitSound = hitSounds[nextHitSoundIndex];
|
||||||
|
|
||||||
hitSound.Samples = maniaObject.GetGameplaySamples();
|
hitSound.Samples = maniaObject.GetGameplaySamples();
|
||||||
hitSound.Play();
|
hitSound.Play();
|
||||||
|
|
||||||
nextHitSound = (nextHitSound + 1) % max_concurrent_hitsounds;
|
nextHitSoundIndex = (nextHitSoundIndex + 1) % max_concurrent_hitsounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user