Game Development Reference
In-Depth Information
Why?
Alpha channels—or the channels that define what parts of the image
to render transparent—can be created in Photoshop and Unity will
recognize them upon import. However, for black-and-white images
like this one, Unity can generate an alpha automatically. It just looks at
the grayscale image and the parts of the image that are white become
opaque and black pixels are rendered as transparent.
Step 15: Apply this color texture to the WaterSteam_Material. In the
Project panel, click once on the WaterSteam_Material (this will bring it
up in the Inspector panel). In the Inspector panel, notice that the Particle
Texture area swatch says None with a little Select subbutton. Click that
Select and then double-click WaterSteam_Color in the Select Texture2D
window (you may have to scroll down to find all of these options).
Step 16: Use WaterSteam_Material as the material for the WaterSteam
Emitter's Particle Renderer component. In the Hierarchy view, Select Water
SteamEmitter. In the Inspector, scroll down to see the Particle Renderer
section. Expand the Materials area and make sure the Size input field reads 1.
Then (either click the target icon on the next line and choose WaterSteam_
Material or) drag WaterSteam_Material from the Project panel into the
Element 0 input field.
Step 17: Animate the Particle. Still with WaterSteamEmitter selected in the
Hierarchy panel, move to the Particle Animator component. Ensure that
Does Animate Color? is checked. Then in the Color Animation[x] section
click each of the five color swatches. Look at Figure 6.29 . Notice that there
is a gray color at the top of each, and then a black-white bar at the bottom
of the swatch. This swatch represents the alpha of that color. Each of these
swatches show how the particle will be tinted over its lifetime with Color
Animation[0] representing birth and Color Animation[4] representing the
particle's death. The idea here is to have the alpha very low (mostly black)
at birth and death so the particle fades into and out of existence.
Figure 6.29 Particle Animator settings.
Specific colors are not important, but
be sure the Alpha settings are very
transparent on both Color Animation[0]
and Color Animation[4].
Tips and Tricks
The Alpha setting is changed in the Color Picker (when a color swatch is
clicked) using the A slider.
Step 18: In Particle Animator component change the Size Grow to 0.4.
Search WWH ::




Custom Search