Ejemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         m_boardManagerRef.MoveToCell(new Vector2(currentCell.index.x - 1, currentCell.index.y), gameObject, this);
     }//Move Left
     else if (Input.GetKeyDown(KeyCode.D))
     {
         m_boardManagerRef.MoveToCell(new Vector2(currentCell.index.x + 1, currentCell.index.y), gameObject, this);
     }//Move Right
     else if (Input.GetKeyDown(KeyCode.W))
     {
         m_boardManagerRef.MoveToCell(new Vector2(currentCell.index.x, currentCell.index.y + 1), gameObject, this);
     }//Move Up
     else if (Input.GetKeyDown(KeyCode.S))
     {
         m_boardManagerRef.MoveToCell(new Vector2(currentCell.index.x, currentCell.index.y - 1), gameObject, this);
     }//Move Down
 }