egret-docs-master/Engine3D/Effect/ParticleExportFromUnity/README.md

48 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

* 使用插件导出粒子特效您可以通过在Unity中编辑好一个粒子或者一组粒子特效然后使用Egret3D提供的插件导出放入到Egret3D中播放。
在Unity中准备您的素材资源后按照以下方式导出粒子组。
![](Img_2.png)
导出后获得文件包:
![](Img_3.png)
然后使用以下代码加载该特效组:
----------
private loadParticle():void{
this._particleLoader = new UnitLoader("resource/doc/effect_doc/particle_res/MapConfig.json");
this._particleLoader.addEventListener(LoaderEvent3D.LOADER_COMPLETE, this.onParticleLoad, this);
}
private onParticleLoad(e: LoaderEvent3D): void {
this._view3D.addChild3D(this._particleLoader.container);
}
----------
导出的特效组示例:
![](Img_1.gif)
使用Unity插件导出素材资源的注意事项
* 需要版本Unity4其他版本尚未支持;
* 子发射器仅支持在Birth阶段触发的情况;
* 建立子发射器和母发射器之间的关联目前需要您手动在MapConfig中编辑例如一个ParticleEmitter需要绑定命名为lighting的子发射器触发阶段为BIRTH则可如下图配置
![](Img_4.png)
* 其中Emission和Shape为必备的节点请确保该节点处于勾选中的状态
* 一些未被支持的属性Color by Speed/Size by Speed/Rotation by Speed/External Forces/Collision;
* 控制粒子的最大数量控制粒子的顶点数据在webgl中不超过支持的上限否则会出现显示不正常的情况。导致顶点超过webgl上限的内容有粒子的最大数量/数据节点总数/使用外部模型的情况下模型的顶点个数;
* 编辑贝塞尔曲线的时候曲线不要超过两段。下图为举例说明2段贝塞尔曲线的情况;
![](Img_5.png)
* 谨慎使用world类型的粒子这种类型的粒子会使用CPU检测更新顶点数据导致渲染效率下降。
----------