mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:07:52 +08:00
Apply NRT to GameplaySampleTriggerSource
This commit is contained in:
parent
92e89c7df7
commit
cb07f2399f
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -31,8 +29,10 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
private readonly Container<SkinnableSound> hitSounds;
|
private readonly Container<SkinnableSound> hitSounds;
|
||||||
|
|
||||||
|
private HitObjectLifetimeEntry? mostValidObject;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private IGameplayClock gameplayClock { get; set; }
|
private IGameplayClock gameplayClock { get; set; } = null!;
|
||||||
|
|
||||||
public GameplaySampleTriggerSource(HitObjectContainer hitObjectContainer)
|
public GameplaySampleTriggerSource(HitObjectContainer hitObjectContainer)
|
||||||
{
|
{
|
||||||
@ -45,14 +45,12 @@ namespace osu.Game.Rulesets.UI
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private HitObjectLifetimeEntry mostValidObject;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Play the most appropriate hit sound for the current point in time.
|
/// Play the most appropriate hit sound for the current point in time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void Play()
|
public virtual void Play()
|
||||||
{
|
{
|
||||||
var nextObject = GetMostValidObject();
|
HitObject? nextObject = GetMostValidObject();
|
||||||
|
|
||||||
if (nextObject == null)
|
if (nextObject == null)
|
||||||
return;
|
return;
|
||||||
@ -71,7 +69,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
hitSound.Play();
|
hitSound.Play();
|
||||||
});
|
});
|
||||||
|
|
||||||
protected HitObject GetMostValidObject()
|
protected HitObject? GetMostValidObject()
|
||||||
{
|
{
|
||||||
if (mostValidObject == null || isAlreadyHit(mostValidObject))
|
if (mostValidObject == null || isAlreadyHit(mostValidObject))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user