Fix error on setting anim.name to null.
This commit is contained in:
@@ -11,9 +11,15 @@ namespace Cryville.Crtr.Components {
|
|||||||
SkinContext _skinContext;
|
SkinContext _skinContext;
|
||||||
|
|
||||||
AnimationSpan _anim;
|
AnimationSpan _anim;
|
||||||
|
int _name;
|
||||||
public int Name {
|
public int Name {
|
||||||
set {
|
set {
|
||||||
if (value == 0) return;
|
if (_name == value) return;
|
||||||
|
_name = value;
|
||||||
|
if (value == 0) {
|
||||||
|
_anim = null;
|
||||||
|
}
|
||||||
|
else {
|
||||||
var id = new Identifier(value);
|
var id = new Identifier(value);
|
||||||
AnimationSpan anim;
|
AnimationSpan anim;
|
||||||
if (!ChartPlayer.pskin.animations.TryGetValue(id, out anim)) {
|
if (!ChartPlayer.pskin.animations.TryGetValue(id, out anim)) {
|
||||||
@@ -24,6 +30,7 @@ namespace Cryville.Crtr.Components {
|
|||||||
_anim = anim;
|
_anim = anim;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public float Duration { get; private set; }
|
public float Duration { get; private set; }
|
||||||
|
|
||||||
double _startTime;
|
double _startTime;
|
||||||
|
|||||||
Reference in New Issue
Block a user