CLRGameLogicProxy.cs 802 B

123456789101112131415161718192021222324252627282930313233343536
  1. namespace XGame.Framework
  2. {
  3. internal class CLRGameLogicProxy : IGameLogicProxy
  4. {
  5. private IGameLogic _gameLogic;
  6. public CLRGameLogicProxy(IGameLogic gameLogic)
  7. {
  8. _gameLogic = gameLogic;
  9. }
  10. #region 接口实现
  11. public void Init()
  12. {
  13. _gameLogic?.Init();
  14. }
  15. public void Start()
  16. {
  17. _gameLogic?.Start();
  18. }
  19. public void Update(int millisecond)
  20. {
  21. _gameLogic?.Update(millisecond);
  22. }
  23. public void LateUpdate(int millisecond)
  24. {
  25. _gameLogic?.LateUpdate(millisecond);
  26. }
  27. public void Dispose()
  28. {
  29. _gameLogic?.Dispose();
  30. _gameLogic = null;
  31. }
  32. #endregion
  33. }
  34. }