12345678910111213141516171819202122232425262728293031323334 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
-
- public class PlayerController : MonoBehaviour
- {
- public Transform camTransform;
- private void Update()
- {
- if (Input.GetKeyDown(KeyCode.Mouse0))
- {
- ClientSend.PlayerShoot(camTransform.forward);
- }
- }
-
- private void FixedUpdate()
- {
- SendInputToServer();
- }
-
- private void SendInputToServer()
- {
- bool[] _inputs = new bool[]
- {
- Input.GetKey(KeyCode.Z),
- Input.GetKey(KeyCode.S),
- Input.GetKey(KeyCode.Q),
- Input.GetKey(KeyCode.D),
- Input.GetKey(KeyCode.Space)
- };
-
- ClientSend.PlayerMovement(_inputs);
- }
- }
|