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

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.

主站蜘蛛池模板: 台安县| 吉水县| 长沙县| 桦南县| 辽宁省| 石楼县| 吉木萨尔县| 星子县| 芜湖市| 霸州市| 饶平县| 夹江县| 舟山市| 兴安盟| 大连市| 平原县| 建平县| 昌都县| 鄱阳县| 临清市| 乌海市| 昭通市| 台安县| 怀集县| 阳原县| 治县。| 连南| 海安县| 万山特区| 太湖县| 利川市| 镶黄旗| 林口县| 新乡县| 色达县| 万载县| 鄢陵县| 潍坊市| 新丰县| 临沧市| 日喀则市|