public void clearColliders() { if (prevBoxes != null) { enableColliders(prevBoxes, false); } frameCounter = 0; prevAnimation = animationsX42.clear; boxes = null; }
public void setColliders(animationsX42 animation) { if (animation == animationsX42.clear) { clearColliders(); } else { if (prevAnimation != animation) { frameCounter = 0; prevAnimation = animation; } if (frameCounter < colliders [(int)animation].Length) { boxes = colliders [(int)animation] [frameCounter]; } else { Debug.Log("mismatched hitbox: " + animation); } if (boxes != null) { enableColliders(boxes, true); } if (prevBoxes != null) { enableColliders(prevBoxes, false); } if ((int)animation > 1) { Debug.Log(prevAnimation + " " + animation + " " + frameCounter + "boxes " + boxes.Length + "prev " + prevBoxes.Length); } prevBoxes = boxes; frameCounter++; } }