public void ReplaceTileModels(TileModels newValue) { var index = GameComponentsLookup.TileModels; var component = CreateComponent <TileModelsComponent>(index); component.value = newValue; ReplaceComponent(index, component); }
public GameEntity SetTileModels(TileModels newValue) { if (hasTileModels) { throw new Entitas.EntitasException("Could not set TileModels!\n" + this + " already has an entity with TileModelsComponent!", "You should check if the context already has a tileModelsEntity before setting it or use context.ReplaceTileModels()."); } var entity = CreateEntity(); entity.AddTileModels(newValue); return(entity); }
public void ReplaceTileModels(TileModels newValue) { var entity = tileModelsEntity; if (entity == null) { entity = SetTileModels(newValue); } else { entity.ReplaceTileModels(newValue); } }