大约有 197 项符合查询结果, 库内数据总量为 30,786 项。 (搜索耗时: 0.0044 秒)
...is.progressBar.changeHandler = new Laya.Handler(this, this.onChange); this.owner.addChild(this.progressBar); Laya.timer.loop(100, this, this.changeValue); }); } // 模拟进度条加载 private changeValue(): void { if (this.progressBar.value >= 1) this.progressBar.value = 0; this.progressBar.val...
来源: Laya3.0_文档 发布时间: 20241014
...能吗,这样可以 onAwake() { const self = this; self.gameObj = self.owner as Laya.Sprite; Laya.Physics.I.worldRoot = self.gameObj; this.cameraRect = new Laya.Rectangle(0, 0, 2000, 1000); this.gameObj.scrollRect = this.cameraRect; } onUpdate() { this.cameraRect.x = this.target.x - 400; this.came...
来源: Laya_社区 发布时间: 20190214
...s._started) { this._started = true; this.enabled = true; } var ground=this.owner.getChildByName("ground"); //****新增代码*****, ground.addComponent(Laya.ChainCollider); //****新增代码*****, this._chains=ground.getComponent(Laya.ChainCo...
来源: Laya_社区 发布时间: 20181130
...enemyHit); var _enemy=this.enemyHit.collider.owner as Laya.Sprite3D; if(_enemy.layer==6) { if(this.enemy!=null)return console.log("检测...
来源: Laya_社区 发布时间: 20231120
...n(() => { this.createBtn(); this.createHbox(); // 添加HBox组件 this.owner.addChild(this.hbox); }); } // 创建Button组件 private createBtn(): void { this.btn1 = new Laya.Button(this.skins); this.btn2 = new Laya.Button(this.skins); this.btn3 = new Laya.Button(this.skins); } // 创建HBox组...
来源: Laya3.0_文档 发布时间: 20241014
...sition.y = this.touch.position.y; //根据移动的距离进行旋转 this.owner.transform.rotate(new Laya.Vector3(1 * deltaY /2, 1 * deltaX / 2, 0), true, false); } } else if (2 === touchCount){ this._text.text = "触控点为2"; this.isTwoTouch = true; //获取两个触碰点 var touch = this._sce...
来源: Laya2.0_文档 发布时间: 20210715
...sition.y = this.touch.position.y; //根据移动的距离进行旋转 this.owner.transform.rotate(new Laya.Vector3(1 * deltaY /2, 1 * deltaX / 2, 0), true, false); } } else if (2 === touchCount){ this._text.text = "触控点为2"; this.isTwoTouch = true; //获取两个触碰点 var touch = this._sce...
来源: Laya2.0_文档 发布时间: 20210715
...此方法只执行一次 */ onAwake() { //得到3D对象 this.obj = this.owner; } onStart() { } /** * 覆写组件更新方法(相当于帧循环) */ onUpdate() { //所属脚本对象旋转更新 this.obj.transform.rotate(this.rotation, false, false) } onDisable() { console.log("组件设置为...
来源: Laya_社区 发布时间: 20200611
...; } onEnable(): void { //设置初始速度 let rig: Laya.RigidBody = this.owner.getComponent(Laya.RigidBody); rig.setVelocity({ x: 0, y: -10 }); } onTriggerEnter(other: any, self: any, contact: any): void { //如果被碰到,则移除子弹 this.owner.removeSelf(); } onUpdate(): void { //如果...
来源: Laya3.0_文档 发布时间: 20241014
... public animator:Laya.Animator = null; public Init(){ this.sprite = this.owner as Laya.Sprite3D; this.animator = this.sprite.getComponent(Laya.Animator) as Laya.Animator; console.log("11"); } public RoleMove(dir:Laya.Vector3) { let norDir:Laya.Vector3 = Laya.Vector3.ZERO; Laya.Vector3.normalize(...
来源: Laya_社区 发布时间: 20191026