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

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.

主站蜘蛛池模板: 达孜县| 年辖:市辖区| 耿马| 大港区| 乐清市| 闻喜县| 舒城县| 莫力| 岑溪市| 江都市| 三台县| 道孚县| 上高县| 灵台县| 新宁县| 南开区| 巫山县| 呼玛县| 梁河县| 通山县| 汽车| 德州市| 庆阳市| 阿巴嘎旗| 滨州市| 定远县| 西充县| 潼关县| 房产| 乌兰浩特市| 加查县| 田阳县| 宜宾县| 蒙城县| 清徐县| 双城市| 中阳县| 温泉县| 定襄县| 文化| 察隅县|