public void ReplaceSpriteService(ISpritesService newInstance) { var index = MetaComponentsLookup.SpriteService; var component = CreateComponent <SpriteServiceComponent>(index); component.instance = newInstance; ReplaceComponent(index, component); }
public MetaEntity SetSpriteService(ISpritesService newInstance) { if (hasSpriteService) { throw new Entitas.EntitasException("Could not set SpriteService!\n" + this + " already has an entity with SpriteServiceComponent!", "You should check if the context already has a spriteServiceEntity before setting it or use context.ReplaceSpriteService()."); } var entity = CreateEntity(); entity.AddSpriteService(newInstance); return(entity); }
public void ReplaceSpriteService(ISpritesService newInstance) { var entity = spriteServiceEntity; if (entity == null) { entity = SetSpriteService(newInstance); } else { entity.ReplaceSpriteService(newInstance); } }
public Services( ILogService log, IInputService input, ISpritesService sprites, LevelService level, ViewService view, GameEntityService gameEntity ) { this.log = log; this.input = input; this.sprites = sprites; this.level = level; this.view = view; this.gameEntity = gameEntity; }
public RenderTilesSystem(Contexts contexts, ISpritesService spritesService) { _spritesService = spritesService; _tiles = contexts.game.GetGroup(GameMatcher.Tile); }