/// <summary> /// WindorsAPI的初始化. /// </summary> public static void OpenWithWindows(Action action) { //注册输入事件 输入事件来自于WindowsAPI StandardIO.GetKeyEvent += WindowsAPI.GetInput; StandardIO.GetMouseButtonEvent += WindowsAPI.GetInputMouse; //将窗体的对应方法绑到核心事件 StandardIO.DebugLogEvent += WindowsAPI.DebugLog; StandardIO.GetMousePositionInPixelEvent += WindowsAPI.GetMousePositionPixel; StandardIO.RendererEvent += WindowsAPI.Renderer; RuntimeEngine.Init(); //在这里添加新的系统 RuntimeEngine.SetSystemUpdate(); //执行引擎的初始化代码 action.Invoke(); RuntimeEngine.Run(); }