[0]视频节点VideoNode无法监听事件
const { regClass, property } = Laya;
import { MainBase } from "./Main.generated";
@regClass()
export class Main extends MainBase {
onAwake() {
this.VideoNode.play();
console.log("Game start"); // 监听视频播放结束事件
this.VideoNode.on('playing', this, () => {
// 在视频结束时添加文本
console.log("-------------");
});
this.VideoNode.on('click', this, () => {
this.Button.alpha = 1;
this.VideoNode.pause();
// 在视频结束时添加文本
console.log("---------END----");
});
}
}
import { MainBase } from "./Main.generated";
@regClass()
export class Main extends MainBase {
onAwake() {
this.VideoNode.play();
console.log("Game start"); // 监听视频播放结束事件
this.VideoNode.on('playing', this, () => {
// 在视频结束时添加文本
console.log("-------------");
});
this.VideoNode.on('click', this, () => {
this.Button.alpha = 1;
this.VideoNode.pause();
// 在视频结束时添加文本
console.log("---------END----");
});
}
}
要回复问题请先登录
1 个回复
Laya_Fred
赞同来自: