Find cubmap and use to material

Hello how find cubmap and use to material

1.creat skybox

I use Will Eastcott method create-skybox.js

    app.root.addComponent("script", {
    scripts: [
    { url: 'js/hammer.min.js' },
    { url: 'js/create-skybox.js' }
    ]
})

2. creat material

function createMaterial(d, s, g, n,cubmap) {
    var mat = new pc.PhongMaterial();
    mat.shadingModel = pc.SPECULAR_BLINN;
    mat.diffuse.set(255 / 255, 203 / 255, 57 / 255);
    mat.diffuseMap = d;
    mat.specularMap = s;
    mat.glossMap = g;
    mat.normalMap = n;
    mat.shininess = 100;
    mat.conserveEnergy = true;
    mat.cubeMap = cubmap;
    mat.reflectivity = 1;
    mat.update();
    return mat;
}

3.find cubemap

var cubemap = app.assets.find("cubemap");
cubemap.resource;

4. use to cube

var metal = createMaterial(metald, metals, metalg, metaln,cubemap);
cube.model.model.meshInstances[0].material = metal;

At step 3
can not find the cubemap,how get the cubemap and use it to cube material

thanks ++

Just to clarify: you are not using Editor?

yes
i use only use pc engine

Please help me to solve this problem:
thanks more!

In section 3 is cubemap.resource a valid cubemap?

I have a feeling cubemap loading in engine-only use case may not be working. When you download models to be loaded by the engine there is a conversion step to insert real paths into the data so that they can be loaded with out asset ids (which are basically only used by editor built apps).

Check to see if you can actually load a cubemap and get a valid pc.Texture