protected override void InitializeCore() { base.InitializeCore(); Name = "UIComponentRenderer"; game = (IGame)Services.GetService(typeof(IGame)); input = (InputManager)Services.GetService(typeof(InputManager)); uiSystem = (UISystem)Services.GetService(typeof(UISystem)); rendererManager = new RendererManager(new DefaultRenderersFactory(Services)); batch = uiSystem.Batch; }
protected override void InitializeCore() { base.InitializeCore(); Name = "UIComponentRenderer"; game = (IGame)RenderSystem.Services.GetService(typeof(IGame)); input = (InputManager)RenderSystem.Services.GetService(typeof(InputManager)); uiSystem = (UISystem)RenderSystem.Services.GetService(typeof(UISystem)); graphicsDeviceService = RenderSystem.Services.GetSafeServiceAs<IGraphicsDeviceService>(); if (uiSystem == null) { var gameSytems = RenderSystem.Services.GetServiceAs<IGameSystemCollection>(); uiSystem = new UISystem(RenderSystem.Services); gameSytems.Add(uiSystem); } rendererManager = new RendererManager(new DefaultRenderersFactory(RenderSystem.Services)); batch = uiSystem.Batch; }