大约有 51 项符合查询结果, 库内数据总量为 30,902 项。 (搜索耗时: 0.0034 秒)
... 平移距离 private translate: Laya.Vector3 = new Laya.Vector3(1, 1, 1); constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { // 平移cube this.cube.transform.translate(this.translate, false); } }...
来源: Laya3.0_文档 发布时间: 20240910
...cript extends Laya.Script { @property({ type: Laya.List }) list: Laya.List constructor() { super(); } // 组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { // 给List对象赋值 var data: Array<any> = []; for (var m: number = 0; m < 20; m++) { data.push({ m_lab...
来源: Laya3.0_文档 发布时间: 20240910
...prite3D; @property({ type: Laya.SoundNode }) public sound: Laya.SoundNode; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.sound.source = "resources/sound.wav"; //音频路径 this.sound.lo...
来源: Laya3.0_文档 发布时间: 20240910
...f (instance) { var className: string = instance["__className"] || instance.constructor._$gid; if (className) Pool.recover(className, instance); } } 有了这两种对应的方式,我们可以不用在代码中去关心每个对象的创建和回收,只关心对象的内部逻辑就好了。比...
来源: Laya3.0_文档 发布时间: 20240910
...lare owner : Laya.Sprite3D; @property({ type: Laya.Text }) txt: Laya.Text; constructor() { super(); } onAwake(): void { this.txt.text = "第{n=1}页"; //显示文本的初始化内容 } onStart(): void { let page: number = 1; Laya.timer.frameLoop(10, this, () => { page += 1; //在定时器中让...
来源: Laya3.0_文档 发布时间: 20240910
...取旋转方位信息: class Gyroscope_Sample { private info: Laya.Text; constructor() { Laya.init(550, 400); this.info = new Laya.Text(); this.info.fontSize = 50; this.info.color = "#FFFFFF"; this.info.size(Laya.stage.width, Laya.stage.height); Laya.stage.addChild(this.info); Laya.Gyroscope.insta...
来源: Laya3.0_文档 发布时间: 20240910
...中或者服务器中。 下面是主类的逻辑: class LayaUISample { constructor() { //初始化引擎 Laya.init(0,0); var Hls:any = Laya.Browser.window.Hls;//获取对Hls的引用。 var plyr:any = Laya.Browser.window.plyr;//获取对plyr的引用 //获取video对象,就是页面上命名为...
来源: Laya3.0_文档 发布时间: 20240910
... Laya.Sprite3D; @property( { type : Laya.Label } ) public lab: Laya.Label; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.lab.pos(Laya.stage.width >> 1, Laya.stage.height >> 1)...
来源: Laya3.0_文档 发布时间: 20240910
...roperty } = Laya; @regClass() export class NewScript extends Laya.Script { constructor() { super(); } onMouseClick(evt: Laya.Event): void { // 尝试获取当前位置 Laya.Geolocation.getCurrentPosition( Laya.Handler.create(this, this.onSuccess), Laya.Handler.create(this, this.onError) ); console.l...
来源: Laya3.0_文档 发布时间: 20240910
...type: Laya.Animation }) //在IDE面板中显示属性 ani: Laya.Animation; constructor() { super(); } //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.ani.source = "resources/role.atlas"; //接收动画数据源为图集 thi...
来源: Laya3.0_文档 发布时间: 20240910