• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 473 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0038 秒)

131. 陀螺仪与加速计(TypeScript-LayaAir基础篇(TS)-硬件设备相关) [ 82%]

...lean, rotationInfo: Laya.RotationInfo): void { this.info.text = "alpha:" + Math.floor(rotationInfo.alpha) + '\n' + "beta :" + Math.floor(rotationInfo.beta) + '\n' + "gamma:" + Math.floor(rotationInfo.gamma); } } new Gyroscope_Sample(); ``` ## 2、加速计 ​ `Accelerator`类定期发送设备的...

来源: Laya2.0_文档 发布时间: 20210715

132. 给模型动态添加脚本报错 [ 81%]

...transform.localPosition = new Laya.Vector3(this.startPos.x + (4.5 - Math.random() * 9), this.startPos.y, this.startPos.z + (2.5 - Math.random() * 5));                 console.log('----------------goldnode', goldNode);                 this.playerGoldA...

来源: Laya_社区 发布时间: 20200326

133. layair 两点之间的距离api在哪里 [ 81%]

...点} b 示例:{x:1,y:100} */ function calcDistance(a,b){     return Math.sqrt(Math.pow(a.x-b.x,2)+Math.pow(a.y-b.y,2)); } 2018-08-27 1 1 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 G 相关问题 请问在layaIDE里,怎么调用...

来源: Laya_社区 发布时间: 20180827

134. ts加密md5码封装 [ 81%]

...=> x + start); } to_binary(code: number, bit: number = 8, max: number = Math.pow(2, bit) - 1) { if (code < 0) throw new Error("code should be greater than: 0"); if (code > max) throw new Error("code should be less than: " + max); return this.padding(code.toString(2), bit, "0", false); } to_...

来源: Laya_社区 发布时间: 20190321

135. 骨灰级的bug [ 81%]

...ationPlayer.as 222行 , 二二二。。。。。 _currentKeyframeIndex = Math.max(Math.floor(currentPlayTime / cacheFrameInterval), 0);//TODO:矫正   修正后的正确值: _currentKeyframeIndex = Math.round(currentPlayTime / cacheFrameInterval);//TODO:矫正     不修正的话,此条件...

来源: Laya_社区 发布时间: 20190309

136. _calculateCacheRect函数有bug [ 80%]

...= tRec.y - CacheStyle.CANVAS_EXTEND_EDGE;                 tRec.x = Math.floor(tRec.x + x) - x;                 tRec.y = Math.floor(tRec.y + y) - y;                 tRec.width = Math.floor(tRec.width);                 tRec.height = Math.floor(tRec.height);         ...

来源: Laya_社区 发布时间: 20210615

137. 在LayaAir1.7.3beta中使用WebGL渲染下粒子系统像素颜色丢失的问题 [ 80%]

...eData.startColor=255; particleData.endColor=255; } particleData.startColor=MathUtil.lerp(settings.minStartColor,settings.maxStartColor,Math.random()); particleData.endColor=MathUtil.lerp(settings.minEndColor,settings.maxEndColor,Math.random()); } 改为 if (settings.disableColor){ for (i=0;i < 3;...

来源: Laya_社区 发布时间: 20170416

138. 照相机-3D空间转2D空间 [ 80%]

...new Laya.Vector3(); var scaleDelta = 0; function animate() { _position.x = Math.sin(scaleDelta += 0.01); layaMonkey3D.transform.position = _position; camera.viewport.project(layaMonkey3D.transform.position, camera.projectionViewMatrix, _outPos); //获取的2d坐标必须做兼容屏幕适配操作 l...

来源: Laya_示例 发布时间: 20240930

139. 关于2.0.1版本,rayCastAll方法有bug的问题 [ 80%]

...结果 let rays = []; for (let i = 0; i < 8; i++) { let radis = i * 2 * Math.PI / 8; rays[i] = new Laya.Ray(new Laya.Vector3(0, 0, 0), new Laya.Vector3(Math.cos(radis), 0, Math.sin(radis))); let hitResult = new Array(); this.mainScene.physicsSimulation.rayCastAll(rays[i], hitResult); console.log(...

来源: Laya_社区 发布时间: 20190403

140. 大神们能不能帮忙解决一下一些问题呀,一个新手搞不定呀 [ 80%]

...未过的关数 = [1,2,3,4,5,6,7]; if(第一关过关了){ var 随机数 = Math.floor(Math.random() * 未过的关数.length; var 新的未过的关数 = []; var 剩下关数 = 未过的关数.length - 1; for(var i =0;i<剩下关数;i++){ if(i != 随机数){ 新的未过的关数.push(未过的...

来源: Laya_社区 发布时间: 20180615