NetOuterComponent.cs 517 B

12345678910111213141516171819202122232425262728293031
  1. namespace Model
  2. {
  3. [ObjectEvent]
  4. public class NetOuterComponentEvent : ObjectEvent<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.KCP);
  20. this.MessagePacker = new ProtobufPacker();
  21. this.MessageDispatcher = new ClientDispatcher();
  22. }
  23. public new void Update()
  24. {
  25. base.Update();
  26. }
  27. }
  28. }