大约有 191 项符合查询结果, 库内数据总量为 31,671 项。 (搜索耗时: 0.0033 秒)
...舞台移除模型对象 @param node 节点 */ base_remove(node){ if(node.numChildren<=0)return; console.log('移除',node.name); let obj; for(let i=node.numChildren-1;i>=0;i--){ obj= node.getChildAt(i); obj.destroy(); } } 或者 /* 从舞台移除模型对象 @param node 节点 */ base_rem...
来源: Laya_社区 发布时间: 20191119
...le.log("startScene"); console.log(Laya.stage.name); console.log(Laya.stage.numChildren); console.log(this.numChildren); console.log(this.parent); console.log(this.name); } }这个同样是null export default class game_mgr extends Laya.Script { constructor() { super(); console.log(this.owner); } } ...
来源: Laya_社区 发布时间: 20190904
... 1 个回复 Monica - 知识达人 赞同来自: 你可以通过父节点.numChildren()来获取它里边当前子节点的数量 2017-11-04 0 2 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 zeorro 相关问题 两个对象new了一个相...
来源: Laya_社区 发布时间: 20171104
飞机大战实例js版本 for(var i=Laya.stage.numChildren-1;i>0;i--) 遍历所有飞机,为什么i>0 ,这样不是取不到索引为0的飞机了吗?但预览效果为什么又是对的呢? 期待回复,谢谢。 2018-02-07 添加评论 免费帖 --> 分享 微博 QZONE 微信 没...
来源: Laya_社区 发布时间: 20180207
...,当destroy函数调用时会把子节点销毁,所以public function get numChildren(){} 被调用时child为空 所以报错,算是引擎的bug吧,将原函数改为public function get numChildren():int { trace(this); if (!this._childs){ ...
来源: Laya_社区 发布时间: 20170829
...adSprite; }());然后如此使用destroy for (var i = 0; i < Laya.stage.numChildren; i++) { var object = Laya.stage.getChildAt(i); // object.removeSelf(); Laya.stage.removeChildAt(i); object.destroy(true); }该对象继续在屏幕上显示。。。(IDE版本1.7.10.bate) 使用Laya.stage.dest...
来源: Laya_社区 发布时间: 20171012
...Loop() { // 遍历所有飞机,更改飞机状态 for(var i = Laya.stage.numChildren - 1; i > 0; i--) { // 接收舞台子对象 var role = Laya.stage.getChildAt(i); // 判断是否有飞机,并且是否有速度值 if(role && role.speed){ // 根据飞机速度更改飞机的位置 ro...
来源: Laya_社区 发布时间: 20170525
...tected function removeAllChildren(container:Sprite):void { while(container.numChildren > 0) { container.removeChildAt(0); } } protected function createLoading():Sprite { _loadingBg = new Sprite(); _loadingBg.graphics.drawRect(0, 0, _list.width, _list.height, "#000000"); _loadingBg.alpha = .7; _lo...
来源: Laya_社区 发布时间: 20170323
...是一个继承自laya.ui.Dialog的对象,设置this.zOrder = 100;导致numChildren异常,关闭时报错。 开发者往往并不能确定确切的zOrder值,可能预设一个较大的值,如果这值不合规范,应该在接受这个值以后自动调整; 个人认为这是框架应该...
来源: Laya_社区 发布时间: 20171012
...Loop() { // 遍历所有飞机,更改飞机状态 for(var i = Laya.stage.numChildren - 1; i > 0; i--) { // 接收舞台子对象 var role = Laya.stage.getChildAt(i); // 判断是否有飞机,并且是否有速度值 if(role && role.speed){ // 根据飞机速度更改飞机的位置 ro...
来源: Laya_社区 发布时间: 20170525