public void setColliders(animationsWondie animation) { if (animation == animationsWondie.clear) { clearColliders(); } else { checkHitCondition(animation); 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); } prevBoxes = boxes; frameCounter++; } }
public void clearColliders() { if (prevBoxes != null) { enableColliders(prevBoxes, false); } frameCounter = 0; prevAnimation = animationsWondie.clear; boxes = null; }
void checkHitCondition(animationsWondie animation) { if (animation == animationsWondie.heavy02ChargeFingerShot || animation == animationsWondie.heavy02FingerShot || animation == animationsWondie.heavy02FSHit || animation == animationsWondie.heavy02FSMiss || animation == animationsWondie.heavy02HitFinish || animation == animationsWondie.heavy02HitTransition) { timeMaintaining = 0f; } else { timeMaintaining = 0.1f; } }