public void ReplaceBlueprints(Entitas.Blueprints.Unity.Blueprints newValue) { var index = GameComponentsLookup.Blueprints; var component = CreateComponent <BlueprintsComponent>(index); component.value = newValue; ReplaceComponent(index, component); }
public GameEntity SetBlueprints(Entitas.Blueprints.Unity.Blueprints newValue) { if (hasBlueprints) { throw new Entitas.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.Blueprints.Unity.Blueprints newValue) { var entity = blueprintsEntity; if (entity == null) { entity = SetBlueprints(newValue); } else { entity.ReplaceBlueprints(newValue); } }