mirror of
https://github.com/ppy/osu.git
synced 2025-02-28 21:33:22 +08:00
Make Samples null by default and prepopulate in mania
This commit is contained in:
parent
298ac5468f
commit
aeafa5645a
@ -50,7 +50,10 @@ namespace osu.Game.Rulesets.Mania.Objects
|
||||
/// <summary>
|
||||
/// The head note of the hold.
|
||||
/// </summary>
|
||||
public readonly Note Head = new Note();
|
||||
public readonly Note Head = new Note
|
||||
{
|
||||
Samples = new Audio.SampleInfoList()
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The tail note of the hold.
|
||||
|
@ -83,6 +83,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
if (HitObject.Samples != null)
|
||||
{
|
||||
if (HitObject.SampleControlPoint == null)
|
||||
throw new ArgumentNullException(nameof(HitObject.SampleControlPoint), $"{nameof(HitObject)} must always have an attached {nameof(HitObject.SampleControlPoint)}.");
|
||||
@ -104,6 +106,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
Samples.Add(channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Objects
|
||||
/// and can be treated as the default samples for the hit object.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public SampleInfoList Samples = new SampleInfoList();
|
||||
public SampleInfoList Samples;
|
||||
|
||||
[JsonIgnore]
|
||||
public SampleControlPoint SampleControlPoint;
|
||||
|
Loading…
Reference in New Issue
Block a user