当前位置: 首页 > news >正文

烟台建设局网站分销商城加盟

烟台建设局网站,分销商城加盟,wordpress图片上传地址,网站建设的教材//在Ts、js中 this指向当前的这个组件实例 //this下的一个数据成员node#xff0c;指向组件实例化的这个节点 //同样也可以根据节点找到挂载的所有组件 //this.node 指向当前脚本挂载的节点//子节点与父节点的关系 // Node.parent是一个Node,Node.children是一个Node[] // th…//在Ts、js中 this指向当前的这个组件实例 //this下的一个数据成员node指向组件实例化的这个节点 //同样也可以根据节点找到挂载的所有组件 //this.node 指向当前脚本挂载的节点//子节点与父节点的关系 // Node.parent是一个Node,Node.children是一个Node[] // this.node.parent //等同于 console.warn(this.node.parent.name); // this.node.getParent() console.warn(this.node.getParent().name);// this.node.children this.node.children.forEach(element {console.log(子节点)console.log(element.name); });// 替换父节点 Node.parent /Node.setParent(XX) this.node.parent this.AddBtn; console.warn(this.node.parent.name) // this.node.setParent(value: Node) this.node.setParent(this.AddBtn); console.warn(this.node.getParent().name);//添加节点 使用预制的时候property(Node)AddBtn: Node null!;property(Prefab)sprite: Prefab null!; // addChild(child: Node) let tempNode: Node instantiate(this.sprite); // addChild有可能造成内存泄露尤其是加自己玩 this.node.addChild(tempNode); this.node.children.forEach(element {console.log(子节点);console.warn(element.name); }); // siblingIndex:设置位置等同于2.x的setIndex(index: number) // insertChild(child: Node, siblingIndex: number) this.node.insertChild(tempNode, 0); this.node.children.forEach(element {console.log(子节点);console.warn(element.name); }); // getSiblingIndex() // setSiblingIndex(index: number)//节点查找 find() //从1级节点开始查找 getChildByName(name: string)//下级节点 getChildByPath(path: string)//从下级节点开始算起往下找 // let node find(Canvas/Test); // console.log(node) // node this.node.getChildByName(Label) // node.getComponent(Label).string 哈哈; // // node this.node.getChildByName(Label)?.getChildByName(Label); //等同于下面这一个行代码 // node this.node.getChildByPath(Label/Label); // node.getComponent(Label).string ~哈哈~;//节点移除 removeFromParent() removeChild(child: this | Node) removeAllChildren() //节点判断 isChildOf(parent: this | Scene | null) isValid // let labelNode this.node.getChildByPath(Label/Label); // console.log(labelNode.isChildOf(this.node)) // 节点是否销毁 // console.log(this.node.isValid) //组件查找 //先找节点 再找节点上挂载的组件 // 我测试的结果挂的BoxCollider 查找Collider一样起效果 //根据类型来查找需要引入 getComponentT extends Component //根据名字来查找不需要引入 getComponent(className: string) getComponentsT extends Component getComponents(className: string) getComponentInChildrenT extends Component getComponentInChildren(className: string) getComponentsInChildrenT extends Component getComponentsInChildren(className: string) //添加移除组件 addComponentT extends Component addComponent(className: string) removeComponentT extends Component removeComponent(classNameOrInstance: string | Component) //销毁节点 destroy() destroyAllChildren() //事件监听 常用前两 on(type: string | NodeEventType, callback: Function, target?: unknown, useCapture?: boolean) //this.node.on(Input.EventType.TOUCH_MOVE, this.onTouch, this); off(type: string | NodeEventType, callback: Function, target?: unknown, useCapture?: boolean) //this.node.off(Input.EventType.TOUCH_MOVE, this.onTouch, this); once(type: string | NodeEventType, callback: Function, target?: unknown, useCapture?: boolean) //通常用非官方分装的EventListener.ts不用这些 emit(type: string, arg0?: any, arg1?: any, arg2?: any, arg3?: any, arg4?: any) dispatchEvent(event: Event) hasEventListener(type: string, callback?: Function, target?: unknown) targetOff(target: unknown) 有时候脑袋一热就问人家怎么样才能简简单单的组件化开发一款游戏怎么样才能合理的把你想要的功能代码化不知道问烦了几个家伙了经常回复我的就是那个节点有要求你就单独挂一个脚本你管它那么多干啥 有时间就学一下3.x就是没3D的素材至于为啥不透露了
http://www.w-s-a.com/news/859554/

相关文章:

  • 网站软件免费下载安装泰安网站建设收费标准
  • 部署iis网站校园网站设计毕业设计
  • 网站快慢由什么决定塘沽手机网站建设
  • 苏州那家公司做网站比较好装修队做网站
  • 外贸网站推广中山网站流量团队
  • 网站前端设计培训做一份网站的步zou
  • 网站备案拍照茶叶网页设计素材
  • wordpress 手机商城模板关键词优化软件有哪些
  • 网站301做排名python做的网站如何部署
  • 昆山做企业网站工信部网站 备案
  • 做英文的小说网站有哪些网站做qq登录
  • 湖州建设局招投标网站深圳广告公司集中在哪里
  • 重庆主城推广网站建设商城网站建设预算
  • 宁波品牌网站推广优化公司开发公司工程部工作总结
  • 长沙建站模板微信网站建设方案
  • 不让网站在手机怎么做门户网站 模板之家
  • 网站建设及推广图片wordpress文章摘要调用
  • 手机版网站案例全国信息企业公示系统
  • 模仿别人网站建设银行广州招聘网站
  • 沧州网站建设沧州内页优化
  • 代加工网站有哪些专门做网站关键词排名
  • 郑州做景区网站建设公司软件开发者模式怎么打开
  • 长沙企业网站建设哪家好做app一般多少钱
  • 南宁一站网网络技术有限公司网站开发技术应用领域
  • 公司网站建设方案ppt专业构建网站的公司
  • 深圳网站建设方维网络网站框架设计好后怎么做
  • 合肥网站建设过程网站栏目建设调研
  • 手机访问网站页面丢失北京电商平台网站建设
  • 郑州网站怎么推广中山 网站关键词优化
  • 国外试用网站空间网站建设与管理题目