mirror of
https://github.com/osukey/osukey.git
synced 2025-05-02 20:27:27 +09:00
Refactor SkinnableSound.Samples
to be non-nullable
This commit is contained in:
parent
8a9a6c733c
commit
74ab036f3e
@ -376,7 +376,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
|
|
||||||
protected override void OnFree()
|
protected override void OnFree()
|
||||||
{
|
{
|
||||||
slidingSample.Samples = null;
|
slidingSample.ClearSamples();
|
||||||
base.OnFree();
|
base.OnFree();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
PathVersion.UnbindFrom(HitObject.Path.Version);
|
PathVersion.UnbindFrom(HitObject.Path.Version);
|
||||||
|
|
||||||
slidingSample.Samples = null;
|
slidingSample?.ClearSamples();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadSamples()
|
protected override void LoadSamples()
|
||||||
|
@ -119,7 +119,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
base.OnFree();
|
base.OnFree();
|
||||||
|
|
||||||
spinningSample.Samples = null;
|
spinningSample.ClearSamples();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadSamples()
|
protected override void LoadSamples()
|
||||||
|
@ -303,8 +303,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
samplesBindable.CollectionChanged -= onSamplesChanged;
|
samplesBindable.CollectionChanged -= onSamplesChanged;
|
||||||
|
|
||||||
// Release the samples for other hitobjects to use.
|
// Release the samples for other hitobjects to use.
|
||||||
if (Samples != null)
|
Samples?.ClearSamples();
|
||||||
Samples.Samples = null;
|
|
||||||
|
|
||||||
foreach (var obj in nestedHitObjects)
|
foreach (var obj in nestedHitObjects)
|
||||||
{
|
{
|
||||||
|
@ -75,13 +75,11 @@ namespace osu.Game.Skinning
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The samples that should be played.
|
/// The samples that should be played.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ISampleInfo[]? Samples
|
public ISampleInfo[] Samples
|
||||||
{
|
{
|
||||||
get => samples;
|
get => samples;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
value ??= Array.Empty<ISampleInfo>();
|
|
||||||
|
|
||||||
if (samples == value)
|
if (samples == value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -92,6 +90,8 @@ namespace osu.Game.Skinning
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearSamples() => Samples = Array.Empty<ISampleInfo>();
|
||||||
|
|
||||||
private bool looping;
|
private bool looping;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user