public void setHitBox(hitBoxes val)
 {
     if (val != hitBoxes.clear)
     {
         localCollider.SetPath(0, colliders[(int)val].GetPath(0));
         return;
     }
     localCollider.pathCount = 0;
 }
Ejemplo n.º 2
0
 public void setHitBox(hitBoxes val)
 {
     if(val != hitBoxes.clear)
     {
         localCollider.SetPath(0, colliders[(int)val].GetPath(0));
         return;
     }
     localCollider.pathCount = 0;
 }
 void Start()
 {
     // Set up an array so our script can more easily set up the hit boxes
     colliders = new PolygonCollider2D[] { box1, box2 };
     val       = hitBoxes.frame2Box;
     // Create a polygon collider
     localCollider           = gameObject.AddComponent <PolygonCollider2D>();
     localCollider.isTrigger = true; // Set as a trigger so it doesn't collide with our environment
     localCollider.pathCount = 0;    // Clear auto-generated polygons
 }
Ejemplo n.º 4
0
 public void setHitBox(hitBoxes val)
 {
     if (val != hitBoxes.clear)
     {
         // Debug.Log("HI");
         localCollider.SetPath(0, colliders[(int)val].GetPath(0));
         return;
     }
     resetHitBox();
 }
 public void setHitBox()
 {
     //localCollider.pathCount = 0;
     if (val != hitBoxes.clear)
     {
         localCollider.SetPath(0, colliders[(int)val].GetPath(0));
         val++;
         return;
     }
     localCollider.pathCount = 0;
     val = hitBoxes.frame2Box;
 }
Ejemplo n.º 6
0
    public void setHitBox(hitBoxes val)
    {
        healthsDamaged.Clear(); // Clear the list of damaged healths everytime we start a new attack

        // Set the polygon collider to be equal as the target one
        if (val != hitBoxes.clear)
        {
            localCollider.SetPath(0, colliders[(int)val].GetPath(0));
            return;
        }

        // If the value is Clear, set the pathcount of the polygoncollider2D to 0 (No Collisions)
        localCollider.pathCount = 0;
    }
 public void setHitBox(hitBoxes num)
 {
 }