public void ReplaceAssetConfig(Features.Config.IAssetConfig newValue) { var index = ConfigComponentsLookup.AssetConfig; var component = (AssetConfigComponent)CreateComponent(index, typeof(AssetConfigComponent)); component.value = newValue; ReplaceComponent(index, component); }
public ConfigEntity SetAssetConfig(Features.Config.IAssetConfig newValue) { if (hasAssetConfig) { throw new Entitas.EntitasException("Could not set AssetConfig!\n" + this + " already has an entity with AssetConfigComponent!", "You should check if the context already has a assetConfigEntity before setting it or use context.ReplaceAssetConfig()."); } var entity = CreateEntity(); entity.AddAssetConfig(newValue); return(entity); }
public void ReplaceAssetConfig(Features.Config.IAssetConfig newValue) { var entity = assetConfigEntity; if (entity == null) { entity = SetAssetConfig(newValue); } else { entity.ReplaceAssetConfig(newValue); } }