
Unity Certified Programmer Exam Guide
By :

In this chapter, we will incorporate and extend the scriptable objects that heavily helped make our player and the enemy ships in the previous chapter. We will customize a new shop scene, where we will add new upgrades for the player's ship with the use of scriptable objects.
We will also look at the common uses of raycasts; if you aren't familiar with them, they're best described as an invisible laser that shoots from one point to another:
Figure 5.1 – Identifying game objects with a raycast
When the ray hits a game object with a collider, it can retrieve information about the object, and then we can go a little further and manipulate the object we've hit. For example, we can cast a ray to a game object cube, and the ray will confirm to us that it's a cube. Because we have the cube's reference, we can change its color or scale, or position or destroy it – we can pretty...