public void ReplaceIngredientViewFactory(IngredientViewFactory newValue) { var index = GameComponentsLookup.IngredientViewFactory; var component = CreateComponent <IngredientViewFactoryComponent>(index); component.value = newValue; ReplaceComponent(index, component); }
public GameEntity SetIngredientViewFactory(IngredientViewFactory newValue) { if (hasIngredientViewFactory) { throw new Entitas.EntitasException("Could not set IngredientViewFactory!\n" + this + " already has an entity with IngredientViewFactoryComponent!", "You should check if the context already has a ingredientViewFactoryEntity before setting it or use context.ReplaceIngredientViewFactory()."); } var entity = CreateEntity(); entity.AddIngredientViewFactory(newValue); return(entity); }
public void ReplaceIngredientViewFactory(IngredientViewFactory newValue) { var entity = ingredientViewFactoryEntity; if (entity == null) { entity = SetIngredientViewFactory(newValue); } else { entity.ReplaceIngredientViewFactory(newValue); } }