|
@@ -14,7 +14,7 @@ Component({
|
|
|
async detached() {
|
|
|
console.error('detached')
|
|
|
this.video1 && (this.video1 = null);
|
|
|
- this.video12 && (this.video12 = null);
|
|
|
+ // this.video12 && (this.video12 = null);
|
|
|
this.video2 && (this.video2 = null);
|
|
|
this.animator1 && (this.animator1 = null);
|
|
|
this.animator2 && (this.animator2 = null);
|
|
@@ -101,12 +101,12 @@ Component({
|
|
|
console.warn('item1 load', el)
|
|
|
const gltf = el.getComponent("gltf");
|
|
|
const video = this.scene.assets.getAsset("video-texture", "item1-v");
|
|
|
- const video12 = this.scene.assets.getAsset("video-texture", "item12-v");
|
|
|
+ // const video12 = this.scene.assets.getAsset("video-texture", "item12-v");
|
|
|
const newMat = this.scene.assets.getAsset("material", "item1-m");
|
|
|
- const newMat2 = this.scene.assets.getAsset("material", "item12-m");
|
|
|
+ // const newMat2 = this.scene.assets.getAsset("material", "item12-m");
|
|
|
|
|
|
this.video1 = video
|
|
|
- this.video12 = video12
|
|
|
+ // this.video12 = video12
|
|
|
console.log('this.video1', this.video1)
|
|
|
this.video1.onPlay = () => {
|
|
|
console.warn('video1 playing')
|
|
@@ -121,7 +121,7 @@ Component({
|
|
|
this.setData({
|
|
|
isVideoEnd1: true
|
|
|
})
|
|
|
- this.video12 && this.video12.play();
|
|
|
+ // this.video12 && this.video12.play();
|
|
|
}
|
|
|
const animator = el.getComponent("animator");
|
|
|
this.animator1 = animator
|
|
@@ -129,20 +129,7 @@ Component({
|
|
|
console.warn('this.animator1', this.animator1)
|
|
|
const othergltf = this.scene.assets.getAsset("gltf", "item1")
|
|
|
|
|
|
- // console.error('meshes', gltf.meshes)
|
|
|
|
|
|
- // mesh_video1_16978video1
|
|
|
- //mesh_video2_16942video2
|
|
|
-
|
|
|
- // console.log('1', gltf.getPrimitivesByMeshName('mesh_video1_16978video1'))
|
|
|
- // console.log('2', gltf.getPrimitivesByMeshName('mesh_video2_16942video2'))
|
|
|
-
|
|
|
-
|
|
|
- // console.error('othergltf', othergltf)
|
|
|
- // for (const mesh of gltf.meshes) {
|
|
|
- // // mesh.material = newMat
|
|
|
- // console.warn('gltf-m', mesh)
|
|
|
- // }
|
|
|
|
|
|
|
|
|
for (const mesh of othergltf.model.meshes) {
|
|
@@ -155,21 +142,15 @@ Component({
|
|
|
mesh.material = newMat
|
|
|
}
|
|
|
}
|
|
|
- if (String(mesh.name).includes('video2')) {
|
|
|
- const videoMesh2 = gltf.getPrimitivesByMeshName(mesh.name)
|
|
|
- console.warn('videoMesh2', mesh.name, videoMesh2[0].nodeName)
|
|
|
- for (const mesh of gltf.getPrimitivesByNodeName(videoMesh2[0].nodeName)) {
|
|
|
- mesh.material = newMat2
|
|
|
- }
|
|
|
- }
|
|
|
+ // if (String(mesh.name).includes('video2')) {
|
|
|
+ // const videoMesh2 = gltf.getPrimitivesByMeshName(mesh.name)
|
|
|
+ // console.warn('videoMesh2', mesh.name, videoMesh2[0].nodeName)
|
|
|
+ // for (const mesh of gltf.getPrimitivesByNodeName(videoMesh2[0].nodeName)) {
|
|
|
+ // mesh.material = newMat2
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- // for (const mesh of gltf.getPrimitivesByNodeName('node_video2_-7072')) {
|
|
|
- // mesh.material = newMat2
|
|
|
- // // console.warn('mesh2', mesh)
|
|
|
- // }
|
|
|
-
|
|
|
},
|
|
|
handleItem2Loaded({
|
|
|
detail
|