
cocos creator 3d
文章平均质量分 78
cocos creator 3d 技术心得
瓶叔
这个作者很懒,什么都没留下…
展开
-
cocos creator 3d material和sharedMaterial
划重点:1)和其他引擎类似,material是实例化出来的,作用域只针对当前mesh节点;sharedMaterial是共享材质,作用于所有关联的mesh节点。2)只要通过接口获取过material,之后无论做什么操作都不会生成新的材质实例。3)替换mesh的material会同时替换其sharedMaterial。测试脚本如下,做了三次不同的测试: @property(ModelComponent) model1 : ModelComponent = null; @property原创 2020-06-24 09:40:11 · 1931 阅读 · 0 评论 -
cocos creator 3d 物理引擎分组掩码的使用(group和mask)
1、引擎默认情况下,group = 1,mask = -1。2、如下代码块说明了使用方法,this.plane.setGroup(1 << 0); //默认分组为0this.collider.setGroup(1 << 1); //设置分组layer = 1this.collider.setMask((1 << 2) + (1 << 0)); //碰撞层:layer = 2,layer = 0this.collider2.setGroup原创 2020-06-23 19:02:52 · 1896 阅读 · 0 评论 -
cocos creator 3d 同步加载代码块
基于ES6 API,主要用到了 await async Promise 三个APITypeScript脚本代码: async start() { await this.loadTest(); console.log("this is second print."); } async loadTest() { let gamePromise = this.loadAsync(); await gameP原创 2020-06-22 21:06:14 · 665 阅读 · 0 评论