public void ReplaceBarcodeScannerModel(BarcodeScannerModel newValue) { var index = InputComponentsLookup.BarcodeScannerModel; var component = CreateComponent <BarcodeScannerModelComponent>(index); component.value = newValue; ReplaceComponent(index, component); }
public InputEntity SetBarcodeScannerModel(BarcodeScannerModel newValue) { if (hasBarcodeScannerModel) { throw new Entitas.EntitasException("Could not set BarcodeScannerModel!\n" + this + " already has an entity with BarcodeScannerModelComponent!", "You should check if the context already has a barcodeScannerModelEntity before setting it or use context.ReplaceBarcodeScannerModel()."); } var entity = CreateEntity(); entity.AddBarcodeScannerModel(newValue); return(entity); }
public void ReplaceBarcodeScannerModel(BarcodeScannerModel newValue) { var entity = barcodeScannerModelEntity; if (entity == null) { entity = SetBarcodeScannerModel(newValue); } else { entity.ReplaceBarcodeScannerModel(newValue); } }