示例#1
0
    public void ReplaceAssetConfig(Features.Config.IAssetConfig newValue)
    {
        var index     = ConfigComponentsLookup.AssetConfig;
        var component = (AssetConfigComponent)CreateComponent(index, typeof(AssetConfigComponent));

        component.value = newValue;
        ReplaceComponent(index, component);
    }
示例#2
0
    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);
    }
示例#3
0
    public void ReplaceAssetConfig(Features.Config.IAssetConfig newValue)
    {
        var entity = assetConfigEntity;

        if (entity == null)
        {
            entity = SetAssetConfig(newValue);
        }
        else
        {
            entity.ReplaceAssetConfig(newValue);
        }
    }