Version: 5.6
Теги
Префабы (Prefabs)

Static GameObjects

Many optimisations need to know if an object can move during gameplay. Information about a Static (ie, non-moving) object can often be precomputed in the editor in the knowledge that it will not be invalidated by a change in the object’s position. For example, rendering can be optimised by combining several static objects into a single, large object known as a batch.

The inspector for a GameObject has a Static checkbox and menu in the extreme top-right, which is used to inform various different systems in Unity that the object will not move. The object can be marked as static for each of these systems individually, so you can choose not to calculate static optimisations for an object when it isn’t advantageous.

The Static checkbox and drop-down menu, as seen when viewing a GameObject in the Inspector
The Static checkbox and drop-down menu, as seen when viewing a GameObject in the Inspector

Static Settings

The Everything and Nothing enable or disable static status simultaneously for all systems that make use of it. These systems are:

  • Lightmapping: advanced lighting for a scene;
  • Occluder and Occludee: rendering optimization based on the visibility of objects from specific camera positions;
  • Batching: rendering optimization that combines several objects into one larger object;
  • Navigation: the system that enables characters to negotiate obstacles in the scene;
  • Off-mesh Links: connections made by the Navigation system between discontinuous areas of the scene.
  • Reflection Probe: captures a spherical view of its surroundings in all directions.

See the pages about these topics for further details on how the static setting affects performance.

Теги
Префабы (Prefabs)
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961