|
|
@@ -132,7 +132,25 @@ public class PlayerController : MonoBehaviour
|
|
|
{
|
|
|
get
|
|
|
{
|
|
|
- return new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
|
|
|
+ int x = 0;
|
|
|
+ int y = 0;
|
|
|
+ if (Input.GetKey(KeyCode.A))
|
|
|
+ {
|
|
|
+ x--;
|
|
|
+ }
|
|
|
+ if (Input.GetKey(KeyCode.D))
|
|
|
+ {
|
|
|
+ x++;
|
|
|
+ }
|
|
|
+ if (Input.GetKey(KeyCode.S))
|
|
|
+ {
|
|
|
+ y--;
|
|
|
+ }
|
|
|
+ if (Input.GetKey(KeyCode.W))
|
|
|
+ {
|
|
|
+ y++;
|
|
|
+ }
|
|
|
+ return new Vector2(x, y);
|
|
|
}
|
|
|
}
|
|
|
|