public Entity CreateEntity(Vector2 startingPosition) { var swordSpriteAtlas = _linkSpriteAtlasFactory.GetSwordSpriteAtlas(); var result = _scene.CreateEntity(EntityName); var swordAnimation = _scene.CreateEntity("swordAnimation"); swordAnimation.SetParent(result); var swordComponent = new SwordComponent(swordSpriteAtlas); swordAnimation.AddComponent(swordComponent); var swordCollider = _scene.CreateEntity("swordCollider"); swordCollider.SetParent(result); swordCollider.AddComponent(new SwordCollider(swordComponent)); return(result); }
public SwordCollider(SwordComponent swordComponent) { _swordComponent = swordComponent; }