You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
403 B
23 lines
403 B
using System;
|
|
using Unity.Netcode;
|
|
using UnityEngine;
|
|
using UnityEngine.InputSystem;
|
|
|
|
namespace Game {
|
|
public class Player : NetworkBehaviour {
|
|
private void FixedUpdate() {
|
|
Vector2 add = Vector2.zero;
|
|
|
|
var keyboard = Keyboard.current;
|
|
if (keyboard.aKey.isPressed) {
|
|
add.x -= 1;
|
|
}
|
|
|
|
if (keyboard.dKey.isPressed) {
|
|
add.x += 1;
|
|
}
|
|
|
|
transform.Translate(add / 10f);
|
|
}
|
|
}
|
|
}
|
|
|