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

大约有 1,071 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0073 秒)

121. 射线检测报错,outHitInfo.sprite3D=null; [ 81%]

...is.camera = this.scene.scene.getChildByName("Main Camera") as Laya.Camera; console.log("当前摄像机的名字是:" + this.camera.name); }  public _start(state:Laya.RenderState):void{ this.ray = new Laya.Ray(Laya.Vector3.ZERO,Laya.Vector3.ZERO); this.phasorSprite3D = new Laya.PhasorSpriter3D();...

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

122. list item 添加事件后无法监听 [ 81%]

...Item);     return list; }  function updateItem(cell, index) {     console.log(index);     // console.log(cell.dataSource);     cell.setImg(cell.dataSource[index]);     cell.on(Laya.Event.CLICK, function() {         console.log("click")     }) }  function onSelect(in...

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

123. 关于HttpRequest [ 81%]

... new Laya.HttpRequest(); hr.once(Laya.Event.PROGRESS, this, function (e) { console.log(e); }); hr.once(Laya.Event.COMPLETE, this, function () { console.log(hr.data); }); hr.once(Laya.Event.ERROR, this, function (e) { console.log(e); }); hr.send('http://stone.tt.be-xx.com/git/test.php', s, 'post', 't...

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

124. Socket能连接到服务器,客户端发请求也能收到服务端的数据,但是服务端主动推送数据,客户端就是收不到数据? [ 81%]

...n ;         }          ws.onopen = function() {             console.log("---open----");             //设置发信息送类型为:ArrayBuffer             ws.binaryType = "string";             if(SocketJS.OnOpenMsg!=null)SocketJS.OnOpenMsg();         }       ...

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

125. 请问laya2.0 2d物理有射线检测功能吗 [ 81%]

...aya.Physics.I.world world.RayCast(function(fixture,point,normal,fraction){ console.log("fixture",fixture) console.log("point",point) console.log("normal",normal) console.log("fraction",fraction) },{ x:300, y:100 },{ x:300, y:1000 }) //每碰到一个物体就会触发一次回调函数,没碰到...

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

126. async bug 导出小游戏 [ 81%]

...rmal; share.imageUrl = ShareImgUrl; let a = await share.shareAppMessage(); console.log(a) }   转换后代码   onShareClick() { // return __awaiter(this, void 0, void 0, function* () { // let share = SDKCenter.getShare(); // share.title = ShareNormal; // share.imageUrl = ShareImgUrl; // let a = y...

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

127. ProtocolBuffer通信 · LayaAir3.3 · 引擎文档 · LAYABOX [ 80%]

...; @regClass() export class ProtobufDemo extends Laya.Script { onEnable() { console.log("Game start"); } } 2.2 Protobuf示例脚本 引入了protobuf模块就可以直接在项目中使用了,这里我们写了一个简单的示例DEMO,完整代码如下: // src/ProtobufDemo.ts // 引入生成...

来源: Laya3.0_文档 发布时间: 20251010

128. 加载-加载序列 [ 80%]

...is, this.onAssetLoaded), null, null, 2, false); } onAssetLoaded(texture) { console.log(texture.url); // 恢复默认并发加载个数。 if (++numLoaded == 3) { Laya.loader.maxLoader = 5; console.log("All done."); } } } new Loader_Sequence();module laya { import Texture = Laya.Texture; import Handl...

来源: Laya2.0_示例 发布时间: 20251130

129. laya的canvas缩放原理? [ 80%]

...     虽然说laya可以通过一些方法获取缩放的参数,例如 console.log(Laya.stage._canvasTransform); console.log(Laya.stage.clientScaleX); console.log(Laya.stage.clientScaleY);   但是,我的div,在laya还没初始化完成的时候,就已经有了吧。这时候,应该无...

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

130. 请问laya中js如何继承自己写的类 [ 80%]

...unction t1(b) { this.b = b; } //父类方法a t1.prototype.a = function(){ console.log(this.b.x+""+this.b.y); } return t1; }());   ========================= /* * t2继承父类t1 */ var t2 = (function () { function t2() { t2.super(); } t2.prototype.a = function(){ console.log('2222'); } return t2; ...

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