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

Scripting Strategies

Since scripting will consume a great deal of our development time, it will be enormously beneficial to learn some best practices. Scripting is a very broad term, so we will try to limit our exposure in this chapter to situations that are very Unity-specific, focusing on problems surrounding MonoBehaviours, GameObjects, and related functionality.

We will discuss the nuances and advanced topics of the C# language, .NET library, and Mono framework in Chapter 8, Masterful Memory Management.

In this chapter, we will explore ways of applying performance enhancements for the following:

  • Obtaining components in other game objects
  • Optimizing component callbacks (Update(), Awake(), and so on)
  • Using coroutines
  • Using GameObject and Transform efficiently
  • Exchanging messages between different objects
  • Optimizing mathematical calculations
  • Serializing/deserializing during scene and Prefab loading

Whether you have some specific problems in mind that you wish to solve or you just want to learn some techniques for future reference, this chapter will introduce you to a wide array of methods that you can use to improve your scripting efforts now and in the future. In each case, we will explore how and why the performance issue arises, an example situation in which the problem occurs, and one or more solutions to combat the issue.

主站蜘蛛池模板: 宁城县| 历史| 济南市| 陵水| 颍上县| 屏东县| 鄄城县| 莱西市| 五峰| 永福县| 如皋市| 论坛| 扶风县| 台前县| 诏安县| 湾仔区| 京山县| 若羌县| 宝山区| 土默特左旗| 武清区| 获嘉县| 垫江县| 南开区| 青海省| 恩施市| 新宾| 米易县| 蒙山县| 从化市| 潜山县| 青河县| 九龙县| 易门县| 固原市| 利津县| 贺兰县| 淅川县| 香格里拉县| 穆棱市| 西乌珠穆沁旗|