Blueprints
public class PlayerBlueprint : IBlueprint
{
public string Name {get;set;}
public string Class {get;set;}
public int Health {get;set;}
public void Apply(IEntityComponentAccessor entityComponentAccessor, IEntity entity)
{
entityComponentAccessor.AddComponent(entity, new HasNameComponent{ Name = Name });
entityComponentAccessor.AddComponent(entity, new HasClassComponent{ Class = Class });
entityComponentAccessor.AddComponent(entity, new HasHealthComponent{ MaxHealth = Health, CurrentHealth = Health });
}
}Creating via blueprints
var hanSoloEntity = entityCollection.Create(new PlayerBlueprint{
Name = "Han Solo",
Class = "Smuggler",
Health = 100});Applying blueprints to existing entities
How much should a blueprint do?
Batching
Last updated