Fix error on setting anim.name to null.

This commit is contained in:
2023-03-01 00:35:19 +08:00
parent c7e7bd8a77
commit f567a2b78e

View File

@@ -11,9 +11,15 @@ namespace Cryville.Crtr.Components {
SkinContext _skinContext;
AnimationSpan _anim;
int _name;
public int Name {
set {
if (value == 0) return;
if (_name == value) return;
_name = value;
if (value == 0) {
_anim = null;
}
else {
var id = new Identifier(value);
AnimationSpan anim;
if (!ChartPlayer.pskin.animations.TryGetValue(id, out anim)) {
@@ -24,6 +30,7 @@ namespace Cryville.Crtr.Components {
_anim = anim;
}
}
}
public float Duration { get; private set; }
double _startTime;