Game Development Reference
In-Depth Information
Figure 11-28. The alpha channel of the SoftEdges texture
The texture has a slight flare in the center of the alpha channel.
5.
In the Animated Assets, Materials folder, right-click in the Project view and
select Create, Material.
6.
Name it Laser Beam , and assign the Particles, Additive (Soft) shader to it.
7.
Assign the SoftEdges texture to it.
8.
Assign the new material to the Laser Point object by dragging and dropping
it directly onto the object.
9.
Select the Laser Point object, and set the shader's Tiling x field to 20 .
The length of the beam will vary as the laser moves around the scene. With a bit of math, you could
dynamically adjust the tiling according to length in the LaserBeam script.
The Additive (Soft) shader, as you probably noticed, has no color field. To color your laser beam, you
will return to the Line Renderer.
1.
In the Line Renderer component's Parameters section, set the Start and End
Colors to a classic red color.
2.
Click Play, and check out the improvements (Figure 11-29 ).
 
Search WWH ::




Custom Search