This commit is contained in:
CortexCore
2023-07-17 10:23:47 +08:00
parent 3a61f6677b
commit 936a94c84b
17 changed files with 161 additions and 47 deletions

View File

@@ -48,6 +48,11 @@ namespace BITKit.Animations
layerInfos.Add(new());
}
}
if (index > layerInfos.Count - 1)
{
throw new Exception("Index out of range");
}
return layerInfos[index];
}
}
@@ -107,10 +112,9 @@ namespace BITKit.Animations
private void Update()
{
int index = 0;
foreach (var x in layerInfos)
for (var i = 0; i < animator.layerCount; i++)
{
x.currentState = animator.GetCurrentAnimatorStateInfo(index++);
this[i].currentState = animator.GetCurrentAnimatorStateInfo(i);
}
isMatchingTarget = animator.isMatchingTarget;
}