docs: update readme
parent
8e1b4eb086
commit
845365ee27
74
README.md
74
README.md
|
@ -53,24 +53,29 @@ Compares this "Baking mesh" approach with the conventional approach:
|
||||||
* Support overlay, camera space and world space
|
* Support overlay, camera space and world space
|
||||||
* Support changing material property with AnimationClip (AnimatableProperty)
|
* Support changing material property with AnimationClip (AnimatableProperty)
|
||||||

|

|
||||||
|
* [4.0.0+] Support 8+ materials
|
||||||
|
* [4.0.0+] Correct world space particle position when changing window size for standalone platforms (Windows, MacOSX and Linux)
|
||||||
|
* [4.0.0+] Adaptive scaling for UI
|
||||||
|
* [4.0.0+] Mesh sharing group to improve performance
|
||||||
|

|
||||||
|
* [4.0.0+] particle attractor component
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
<br><br><br><br>
|
<br><br><br><br>
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
* [WebGL Demo](https://mob-sakai.github.io/Demos/ParticleEffectForUGUI)
|
* [WebGL Demo](https://mob-sakai.github.io/demos/UIParticle_Demo/index.html)
|
||||||
|
> 
|
||||||
* [WebGL Demo (Cartoon FX & War FX)](https://mob-sakai.github.io/Demos/ParticleEffectForUGUI_CFX)
|
* [WebGL Demo (Cartoon FX & War FX)](https://mob-sakai.github.io/Demos/ParticleEffectForUGUI_CFX)
|
||||||
* [Cartoon FX Free][CFX] & [War FX][WFX] (by [Jean Moreno (JMO)][JMO]) with UIParticle
|
* [Cartoon FX Free][CFX] & [War FX][WFX] (by [Jean Moreno (JMO)][JMO]) with UIParticle
|
||||||
|
> 
|
||||||
|
|
||||||
[CFX]: https://assetstore.unity.com/packages/vfx/particles/cartoon-fx-free-109565
|
[CFX]: https://assetstore.unity.com/packages/vfx/particles/cartoon-fx-free-109565
|
||||||
[WFX]: https://assetstore.unity.com/packages/vfx/particles/war-fx-5669
|
[WFX]: https://assetstore.unity.com/packages/vfx/particles/war-fx-5669
|
||||||
[JMO]: https://assetstore.unity.com/publishers/1669
|
[JMO]: https://assetstore.unity.com/publishers/1669
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br><br><br><br>
|
<br><br><br><br>
|
||||||
|
|
||||||
|
@ -99,7 +104,7 @@ Find the manifest.json file in the Packages folder of your project and add a lin
|
||||||
|
|
||||||
To update the package, change suffix `#{version}` to the target version.
|
To update the package, change suffix `#{version}` to the target version.
|
||||||
|
|
||||||
* `"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git#3.3.0",`
|
* `"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git#4.0.0",`
|
||||||
|
|
||||||
Or, use [UpmGitExtension](https://github.com/mob-sakai/UpmGitExtension) to install and update the package.
|
Or, use [UpmGitExtension](https://github.com/mob-sakai/UpmGitExtension) to install and update the package.
|
||||||
|
|
||||||
|
@ -147,7 +152,7 @@ Unity 2018.2 supports embedded packages.
|
||||||
|
|
||||||
`UIParticle` controls the ParticleSystems that is attached to its own game objects and child game objects.
|
`UIParticle` controls the ParticleSystems that is attached to its own game objects and child game objects.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
| Properties | Description |
|
| Properties | Description |
|
||||||
| -- | -- |
|
| -- | -- |
|
||||||
|
@ -155,7 +160,7 @@ Unity 2018.2 supports embedded packages.
|
||||||
| Ignore Canvas Scale | Ignore the scale of the root canvas.<br>This prevents it from displaying small even in hierarchy scaling mode of `ParticleSystem`. |
|
| Ignore Canvas Scale | Ignore the scale of the root canvas.<br>This prevents it from displaying small even in hierarchy scaling mode of `ParticleSystem`. |
|
||||||
| Scale | Scale the rendering.<br>When the `3D` toggle is enabled, 3D scale (x,y,z) is supported. |
|
| Scale | Scale the rendering.<br>When the `3D` toggle is enabled, 3D scale (x,y,z) is supported. |
|
||||||
| Animatable Properties | If you want update material properties (e.g. `_MainTex_ST`, `_Color`) in AnimationClip, use this to mark the changes. |
|
| Animatable Properties | If you want update material properties (e.g. `_MainTex_ST`, `_Color`) in AnimationClip, use this to mark the changes. |
|
||||||
| Shrink By Material | Shrink rendering by material.<br>Performance will be improved, but in some cases the rendering is not correct. |
|
| Mesh Sharing | Particle simulation results are shared within the same group.<br>A large number of the same effects can be displayed with a small load.<br>When the `Random` toggle is enabled, it will be grouped randomaly. |
|
||||||
| Rendering Order | The ParticleSystems to be rendered.<br>You can change the rendering order and the materials. |
|
| Rendering Order | The ParticleSystems to be rendered.<br>You can change the rendering order and the materials. |
|
||||||
|
|
||||||
NOTE: Press `Refresh` button to reconstruct rendering order based on children ParticleSystem's sorting order and z position.
|
NOTE: Press `Refresh` button to reconstruct rendering order based on children ParticleSystem's sorting order and z position.
|
||||||
|
@ -171,7 +176,7 @@ NOTE: Press `Refresh` button to reconstruct rendering order based on children Pa
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
### With your ParticleSystem prefab
|
### With your existing ParticleSystem prefab
|
||||||
|
|
||||||
1. Select `Game Object/UI/ParticleSystem (Empty)` to create UIParticle.
|
1. Select `Game Object/UI/ParticleSystem (Empty)` to create UIParticle.
|
||||||

|

|
||||||
|
@ -196,30 +201,57 @@ If you want to mask particles, set a stencil supported shader (such as `UI/UIAdd
|
||||||
var go = GameObject.Instantiate(prefab);
|
var go = GameObject.Instantiate(prefab);
|
||||||
var uiParticle = go.AddComponent<UIParticle>();
|
var uiParticle = go.AddComponent<UIParticle>();
|
||||||
|
|
||||||
// Play/Stop the controled ParticleSystems.
|
// Control by ParticleSystem.
|
||||||
|
particleSystem.Play();
|
||||||
|
particleSystem.Emit(10);
|
||||||
|
|
||||||
|
// Control by UIParticle.
|
||||||
uiParticle.Play();
|
uiParticle.Play();
|
||||||
uiParticle.Stop();
|
uiParticle.Stop();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
|
||||||
|
### UIParticleAttractor component
|
||||||
|
|
||||||
|
`UIParticleAttractor` attracts particles generated by the specified ParticleSystem.
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
| Properties | Description |
|
||||||
|
| -- | -- |
|
||||||
|
| Particle System | Attracts particles generated by the specified particle system. |
|
||||||
|
| Distination Radius | Once the particle is within the radius, the particle lifetime will become 0 and `OnAttracted` will be called. |
|
||||||
|
| Delay Rate | Delay to start attracting.<br>It is a percentage of the particle's start lifetime. |
|
||||||
|
| Max Speed | Maximum speed of attracting.<br> If this value is too small, attracting may not be completed by the end of the lifetime and `OnAttracted` may not be called. |
|
||||||
|
| Movement | Attracting movement type. (Linear, Smooth, Sphere) |
|
||||||
|
| OnAttracted | An event called when attracting is complete (per particle). |
|
||||||
|
|
||||||
<br><br><br><br>
|
<br><br><br><br>
|
||||||
|
|
||||||
## Development Note
|
## Development Note
|
||||||
|
|
||||||
### Animatable material property
|
### Shader Limitation
|
||||||
|
|
||||||

|
UIParticles are based on UIVertex.
|
||||||
|
Therefore, only xy components is available for each UV in the shader. (zw components will be ignored).
|
||||||
|
So unfortunately UIParticles will not work well with some shaders.
|
||||||
|
When using custom vertex streams, you can fill zw components with "unnecessary" data.
|
||||||
|
https://github.com/mob-sakai/ParticleEffectForUGUI/issues/191
|
||||||
|
|
||||||
Animation clips can change the material properties of the Renderer, such as ParticleSystemRenderer.
|
- If you need a simple Additive shader, use the `UI/Additive` shader instead.
|
||||||
It uses MaterialPropertyBlock so it does not create new material instances.
|
- If you need a simple alpha-blend shader, use the `UI/Default` shader instead.
|
||||||
Using material properties, you can change UV animation, scale and color etc.
|
|
||||||
|
|
||||||
Well, there is a component called CanvasRenderer.
|
### Overheads
|
||||||
It is used by all Graphic components for UI (Text, Image, Raw Image, etc.) including UIParticle.
|
|
||||||
However, It is **NOT** a Renderer.
|
|
||||||
Therefore, in UIParticle, changing ParticleSystemRenderer's MaterialPropertyBlock by animation clip is ignored.
|
|
||||||
|
|
||||||
To prevent this, Use "Animatable Material Property".
|
UIParticle has some overheads and the batching depends on uGUI.
|
||||||
"Animatable Material Property" gets the necessary properties from ParticleSystemRenderer's MaterialPropertyBlock and sets them to the CanvasRenderer's material.
|
When improving performance, keep the following in mind:
|
||||||
|
- If you are displaying a large number of the same effect, consider `Mesh Sharing` feature in [UIParticle Component](#uiparticle-component).
|
||||||
|
- If you don't like the uniform output, consider `Random Group` feature.
|
||||||
|

|
||||||
|
- If you are using multiple materials, you will have more draw calls.
|
||||||
|
- Consider single material, atlasing the sprites, and using `Sprite` mode in the `Texture Sheet Animation` module in ParticleSystem.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue