LSOperaComponentSystem.cs 844 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using TrueSync;
  2. using UnityEngine;
  3. namespace ET.Client
  4. {
  5. [FriendOf(typeof (LSClientUpdater))]
  6. public static partial class LSOperaComponentSystem
  7. {
  8. [EntitySystem]
  9. private static void Update(this LSOperaComponent self)
  10. {
  11. TSVector2 v = new();
  12. if (Input.GetKey(KeyCode.W))
  13. {
  14. v.y += 1;
  15. }
  16. if (Input.GetKey(KeyCode.A))
  17. {
  18. v.x -= 1;
  19. }
  20. if (Input.GetKey(KeyCode.S))
  21. {
  22. v.y -= 1;
  23. }
  24. if (Input.GetKey(KeyCode.D))
  25. {
  26. v.x += 1;
  27. }
  28. LSClientUpdater lsClientUpdater = self.GetParent<Room>().GetComponent<LSClientUpdater>();
  29. lsClientUpdater.Input.V = v.normalized;
  30. }
  31. }
  32. }