NetOuterComponent.cs 547 B

1234567891011121314151617181920212223242526272829303132
  1. namespace Model
  2. {
  3. [ObjectSystem]
  4. public class NetOuterComponentSystem : ObjectSystem<NetOuterComponent>, IAwake, IUpdate
  5. {
  6. public void Awake()
  7. {
  8. this.Get().Awake();
  9. }
  10. public void Update()
  11. {
  12. this.Get().Update();
  13. }
  14. }
  15. public class NetOuterComponent : NetworkComponent
  16. {
  17. public void Awake()
  18. {
  19. this.Awake(NetworkProtocol.TCP);
  20. this.MessagePacker = new ProtobufPacker();
  21. // 由hotfix中设置
  22. //this.MessageDispatcher = new ClientDispatcher();
  23. }
  24. public new void Update()
  25. {
  26. base.Update();
  27. }
  28. }
  29. }