Esempio n. 1
0
 public void setColliders(animationsRonaldo animation)
 {
     if (animation == animationsRonaldo.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);
         }
         prevBoxes = boxes;
         frameCounter++;
     }
 }
Esempio n. 2
0
 public void clearColliders()
 {
     if (prevBoxes != null)
     {
         enableColliders(prevBoxes, false);
     }
     frameCounter  = 0;
     prevAnimation = animationsRonaldo.clear;
     boxes         = null;
 }