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

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.

主站蜘蛛池模板: 和平县| 旌德县| 凌云县| 太康县| 剑阁县| 布拖县| 长沙市| 兴业县| 信丰县| 集贤县| 房产| 涞水县| 山阳县| 南江县| 利津县| 南漳县| 辽源市| 历史| 平湖市| 丰台区| 瓮安县| 玉环县| 芒康县| 鱼台县| 黔江区| 图们市| 荣成市| 上思县| 延长县| 塘沽区| 响水县| 浮山县| 偏关县| 荣成市| 古田县| 社旗县| 宁陵县| 沙坪坝区| 甘德县| 防城港市| 房产|