Пример #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKey(KeyCode.LeftArrow))
     {
         snakeController.ChangeDirection(Direction.Left);
     }
     if (Input.GetKey(KeyCode.RightArrow))
     {
         snakeController.ChangeDirection(Direction.Right);
     }
     if (Input.GetKey(KeyCode.UpArrow))
     {
         snakeController.ChangeDirection(Direction.Up);
     }
     if (Input.GetKey(KeyCode.DownArrow))
     {
         snakeController.ChangeDirection(Direction.Down);
     }
 }