官术网_书友最值得收藏!

Summary

We have reached the end of this chapter, and we have conquered the majority of our game framework, as we can see in the following diagram:

We have created a game framework that would need only a few changes if we added 1 or 1,000 more enemies to our game. Some of the benefits of this use of reusable code and ScriptableObject is that it will benefit non-programmers, save time, and prevent collaborators from being bogged down in the code.

We have also made it so that if and when we want to add more EnemySpawner points, we can drag and drop more prefabs into our scene and update its ScriptableObject to change the enemy without coding in exact Vector3 locations.

We've covered other common Unity features including instantiating game objects such as enemies and player bullets.

In the next chapter, we will be covering the following scripts:

  • ScoreManager: When an enemy is destroyed, the player will receive a score.
  • ScenesManager: If the player dies, one life will be deducted; if the player loses all of their lives, the level will reset.
  • Sounds: Our ships and bullets will also have added sounds.

Finally, we will be updating the overall structure of our code.

主站蜘蛛池模板: 新营市| 东平县| 江北区| 东港市| 龙州县| 镇雄县| 洛扎县| 望谟县| 常州市| 陈巴尔虎旗| 武鸣县| 乐陵市| 鄂州市| 新乡市| 织金县| 高雄市| 大同市| 新晃| 台江县| 鹤山市| 武冈市| 蕉岭县| 寿阳县| 万安县| 禄劝| 廉江市| 胶南市| 兰州市| 邳州市| 徐闻县| 德钦县| 玉田县| 宿松县| 平阴县| 卢氏县| 信宜市| 拉萨市| 精河县| 三门县| 孙吴县| 潢川县|