LSInputComponentSystem.cs 497 B

1234567891011121314151617181920
  1. using System;
  2. using TrueSync;
  3. namespace ET
  4. {
  5. public static class LSInputComponentSystem
  6. {
  7. [ObjectSystem]
  8. public class LSUpdateSystem: LSUpdateSystem<LSInputComponent>
  9. {
  10. protected override void LSUpdate(LSInputComponent self)
  11. {
  12. LSUnit unit = self.GetParent<LSUnit>();
  13. TSVector2 v2 = self.LSInput.V * 6 * 50 / 1000;
  14. unit.Position += new TSVector(v2.x, 0, v2.y);
  15. }
  16. }
  17. }
  18. }