void Update() { numFrames = transform.childCount; if (transform.childCount != 0) { FrameWrapper prev = null; for (int i = 0; i < transform.childCount; i++) { FrameWrapper fw = transform.GetChild(i).GetComponent <FrameWrapper>(); if (i == frameIndex) { fw.gameObject.SetActive(true); fw.SetAlpha(0.25f); if (showPreviousFrame && i > 0) { prev.gameObject.SetActive(true); prev.SetAlpha(0.1f); } } else { fw.gameObject.SetActive(false); } prev = fw; } } if (!idToChange.Equals(filledId)) { HitBoxWrapper hbw = null; bool filledFields = false; for (int i = 0; i < transform.childCount; i++) { hbw = transform.GetChild(i).GetComponent <FrameWrapper>().GetFirstHitBoxThatMatches(idToChange); if (hbw != null) { changeHitBoxHitData = hbw.HitData; filledFields = true; break; } } if (filledFields) { filledId = idToChange; } } }