public static void Init(FrameCorrect frameCorrect) { List <BaseCorrect.Info> infoList = new List <BaseCorrect.Info>(); for (int index1 = 0; index1 < FrameCorrect.FrameNames.Length; ++index1) { for (int index2 = 0; index2 < frameCorrect.list.Count; ++index2) { if (!(FrameCorrect.FrameNames[index1] != ((Object)((Component)frameCorrect.list[index2].data).get_transform()).get_name())) { infoList.Add(frameCorrect.list[index2]); if (Object.op_Equality((Object)infoList[infoList.Count - 1].data.bone, (Object)null)) { infoList[infoList.Count - 1].data.bone = ((Component)infoList[infoList.Count - 1].data).get_transform(); break; } break; } } } frameCorrect.list = new List <BaseCorrect.Info>((IEnumerable <BaseCorrect.Info>)infoList); }
public static void AddFrameCorrect(GameObject gameObject) { if (!Object.op_Equality((Object)gameObject.GetComponent <FrameCorrect>(), (Object)null)) { return; } FrameCorrect correct = (FrameCorrect)gameObject.AddComponent <FrameCorrect>(); correct.list.Clear(); Transform[] componentsInChildren = (Transform[])((Component)correct).GetComponentsInChildren <Transform>(true); IEnumerable <Transform> frames = correct.GetFrames(componentsInChildren, correct); List <BaseCorrect.Info> infoList = new List <BaseCorrect.Info>(); bool flag = false; using (IEnumerator <Transform> enumerator = frames.GetEnumerator()) { while (((IEnumerator)enumerator).MoveNext()) { Transform current = enumerator.Current; BaseCorrect.Info info = new BaseCorrect.Info((Component)current); foreach (string bodyName in FrameCorrect.bodyNames) { if (!(bodyName != ((Object)current).get_name())) { flag = true; } } info.type = !flag ? BaseCorrect.Info.ProcOrderType.Last : BaseCorrect.Info.ProcOrderType.First; info.bone = current; infoList.Add(info); } } correct.list.AddRange((IEnumerable <BaseCorrect.Info>)infoList); foreach (BaseCorrect.Info info in correct.list) { info.process.type = BaseProcess.Type.Target; } }
private IEnumerable <Transform> GetFrames( Transform[] t, FrameCorrect correct) { List <string> frameNames = (List <string>)null; if (!Object.op_Inequality((Object)((Component)((Component)correct).get_transform().get_parent().get_parent()).GetComponent <TestChara>(), (Object)null)) { return((IEnumerable <Transform>)null); } frameNames = correct.GetFrameNames(FrameCorrect.FrameNames); return((IEnumerable <Transform>)((IEnumerable <Transform>)t).Where <Transform>((Func <Transform, bool>)(frame => frameNames.Contains(((Object)frame).get_name()))).OrderBy <Transform, int>((Func <Transform, int>)(frame => { for (int index = 0; index < frameNames.Count; ++index) { if (FrameCorrect.FrameNames[index] == ((Object)frame).get_name()) { return index; } } return -1; }))); }
private void Start() { FrameCorrect.Init(this); }