Exemplo n.º 1
0
 void Inputs()
 { //Verifica a direção que o player deverá ir
     direction = Vector2.zero;
     if (Input.GetKey(KeybindScript.Instace.WorldKeys["Up"]))
     {
         direction     += Vector2.up;
         directionDodge = new Vector2(0, 1);
         dir            = 0;
     }
     if (Input.GetKey(KeybindScript.Instace.WorldKeys["Left"]))
     {
         direction     += Vector2.left;
         directionDodge = new Vector2(-1, 0);
         dir            = 1;
     }
     if (Input.GetKey(KeybindScript.Instace.WorldKeys["Down"]))
     {
         direction     += Vector2.down;
         directionDodge = new Vector2(0, -1);
         dir            = 2;
     }
     if (Input.GetKey(KeybindScript.Instace.WorldKeys["Right"]))
     {
         direction     += Vector2.right;
         directionDodge = new Vector2(1, 0);
         dir            = 3;
     }
     if (bc.enabled)
     {
         bc.setDirection(direction);
         bc.SetPointIndex(dir);
     }
 }