public GameEntity SetBlueprints(Entitas.Unity.Blueprints.Blueprints newValue) { if (hasBlueprints) { throw new EntitasException("Could not set blueprints!\n" + this + " already has an entity with BlueprintsComponent!", "You should check if the context already has a blueprintsEntity before setting it or use context.ReplaceBlueprints()."); } var entity = CreateEntity(); entity.AddBlueprints(newValue); return(entity); }
public void ReplaceBlueprints(Entitas.Unity.Blueprints.Blueprints newValue) { var entity = blueprintsEntity; if (entity == null) { entity = SetBlueprints(newValue); } else { entity.ReplaceBlueprints(newValue); } }