NetOuterComponent.cs 640 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using Base;
  2. namespace Model
  3. {
  4. [ObjectEvent]
  5. public class NetOuterComponentEvent : ObjectEvent<NetOuterComponent>, IUpdate, IAwake, IAwake<string, int>
  6. {
  7. public void Update()
  8. {
  9. NetworkComponent component = this.GetValue();
  10. component.Update();
  11. }
  12. public void Awake()
  13. {
  14. this.GetValue().Awake();
  15. }
  16. public void Awake(string host, int port)
  17. {
  18. this.GetValue().Awake(host, port);
  19. }
  20. }
  21. public class NetOuterComponent : NetworkComponent
  22. {
  23. public void Awake()
  24. {
  25. this.Awake(NetworkProtocol.UDP);
  26. }
  27. public void Awake(string host, int port)
  28. {
  29. this.Awake(NetworkProtocol.UDP, host, port);
  30. }
  31. }
  32. }