本文整理汇总了C#中EntityManager.getComponent方法的典型用法代码示例。如果您正苦于以下问题:C# EntityManager.getComponent方法的具体用法?C# EntityManager.getComponent怎么用?C# EntityManager.getComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntityManager
的用法示例。
在下文中一共展示了EntityManager.getComponent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LevelScreen
public LevelScreen(LoderGame game, SystemManager systemManager, EntityManager entityManager)
: base(game.screenSystem, ScreenType.Level)
{
_game = game;
_systemManager = systemManager;
_entityManager = entityManager;
_levelSystem = (LevelSystem)_systemManager.getSystem(SystemType.Level);
_content = new ContentManager(_game.Services);
_content.RootDirectory = "Content";
_equipmentSystem = (EquipmentSystem)_systemManager.getSystem(SystemType.Equipment);
_playerId = PlayerSystem.PLAYER_ID;
_pixel = new Texture2D(_game.GraphicsDevice, 1, 1);
_pixel.SetData<Color>(new[] { Color.White });
_arial = _content.Load<SpriteFont>("arial");
_dialogePanes = new List<InteractiveDialoguePane>();
_dialogueFont = _content.Load<SpriteFont>("shared_ui/dialogue_font");
_dialogueOptionFont = _content.Load<SpriteFont>("shared_ui/dialogue_option_font");
ToolbarComponent toolbarComponent = (ToolbarComponent)_entityManager.getComponent(LevelSystem.currentLevelUid, _playerId, ComponentType.Toolbar);
_toolbarDisplay = new ToolbarDisplay(_game.spriteBatch, _equipmentSystem, toolbarComponent);
_inventoryDisplay = new InventoryDisplay(_game.spriteBatch, _equipmentSystem, (InventoryComponent)_entityManager.getComponent(LevelSystem.currentLevelUid, _playerId, ComponentType.Inventory), toolbarComponent);
_inventoryDisplay.inFocus = false;
_toolbarDisplay.inFocus = true;
_healthBar = new LargeHealthBar(_game.spriteBatch);
}