Examples
For the examples in this chapter, we will add to the animations created in Chapter 14 to add a particle effect that occurs when the loot box opens.
Creating a Particle System that displays in the UI
Let’s create a particle system that will pop when the chest opens up. As stated earlier in this chapter, my two preferred ways of displaying particles in front of UI are to either use Screen Space - Camera as the Canvas Render Mode or to use a Render Texture. Since the second option is more complicated, it merits an example. You’ll notice that our Canvases all have their Render Modes set to Screen Space - Overlay, so using a Render Texture is the best method for the way the project is currently set up.
We will create a particle system that is rendered to a texture via a second camera and then have that texture displayed on a Raw Image within the UI.
To create a particle system, complete the following steps. We will work on displaying it in the UI in the...