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

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 to the following areas:

  • Accessing Components
  • Component callbacks (Update(), Awake(), and so on)
  • Coroutines
  • GameObject and Transform usage
  • Interobject communication
  • Mathematical calculations
  • Deserialization such as 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 is occurring, and one or more solutions to combat the issue.

主站蜘蛛池模板: 罗山县| 博罗县| 白玉县| 开平市| 平利县| 沧州市| 德庆县| 镇安县| 安宁市| 广饶县| 余姚市| 庆安县| 彩票| 佛山市| 东海县| 蒲江县| 开化县| 福建省| 华阴市| 河津市| 花垣县| 贵港市| 涞源县| 沭阳县| 兴安盟| 荥阳市| 岚皋县| 旬邑县| 泽库县| 宁都县| 珲春市| 连江县| 深圳市| 盐城市| 双鸭山市| 如东县| 洛阳市| 兰西县| 射洪县| 永年县| 桑日县|