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>>();
|
= new Dictionary<Type, List<ContainerState>>();
|
||||||
|
|
||||||
public ContainerState GetChild(int index, Type handlerType) {
|
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;
|
private bool m_active;
|
||||||
|
|||||||
@@ -144,9 +144,11 @@ namespace Cryville.Crtr {
|
|||||||
Vector3 GetFrame(ContainerState state, float track, Func<ContainerState, Vector3> func) {
|
Vector3 GetFrame(ContainerState state, float track, Func<ContainerState, Vector3> func) {
|
||||||
// TODO
|
// TODO
|
||||||
int id = Mathf.FloorToInt(track);
|
int id = Mathf.FloorToInt(track);
|
||||||
var ts0 = state.GetChild(id, typeof(Chart.Track));
|
if (track == id) {
|
||||||
var p1 = func(ts0);
|
var ts0 = state.GetChild(id, typeof(Chart.Track));
|
||||||
if (track == id) return p1;
|
var p1 = func(ts0);
|
||||||
|
return p1;
|
||||||
|
}
|
||||||
return gh.GetCurrentFrame(func, track);
|
return gh.GetCurrentFrame(func, track);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user