Add exception description for invalid child index.
This commit is contained in:
@@ -24,7 +24,10 @@ namespace Cryville.Crtr.Event {
|
||||
= new Dictionary<Type, List<ContainerState>>();
|
||||
|
||||
public ContainerState GetChild(int index, Type handlerType) {
|
||||
return TypedChildren[handlerType][index];
|
||||
var list = TypedChildren[handlerType];
|
||||
if (index < 0 || index >= list.Count)
|
||||
throw new ArgumentOutOfRangeException("index", string.Format("{0}#{1} does not exist.", list[0].Handler.TypeName, index));
|
||||
return list[index];
|
||||
}
|
||||
|
||||
private bool m_active;
|
||||
|
@@ -144,9 +144,11 @@ namespace Cryville.Crtr {
|
||||
Vector3 GetFrame(ContainerState state, float track, Func<ContainerState, Vector3> func) {
|
||||
// TODO
|
||||
int id = Mathf.FloorToInt(track);
|
||||
var ts0 = state.GetChild(id, typeof(Chart.Track));
|
||||
var p1 = func(ts0);
|
||||
if (track == id) return p1;
|
||||
if (track == id) {
|
||||
var ts0 = state.GetChild(id, typeof(Chart.Track));
|
||||
var p1 = func(ts0);
|
||||
return p1;
|
||||
}
|
||||
return gh.GetCurrentFrame(func, track);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user