Version: 2020.3
言語: 日本語

StaticBatchingUtility

class in UnityEngine

マニュアルに切り替える

説明

StaticBatchingUtility によりオブジェクトが Unity の Static バッチングを活用するようオブジェクトを準備できます。

This step is useful as a performance optimization allowing engine to reduce number of draw-calls dramatically, but keep amount of rendered geometry intact.

By calling one of the Combine methods you will create an internal mesh which will contain combined geometry, however each original GameObject will be present in the Scene and will be culled individually. The fact that GameObjects can be culled individually allows run-time to render the same amount of geometry as it would without batching, unlike combining geometry in the modeling tool. Combining geometry in the modeling tool prevents efficient culling and results in much higher amount of geometry being rendered.

Note that you do not need to call Combine methods on objects which were already marked as "Static" in the Editor. They will be prepared for static batching automatically during the Build Player step.

重要: 同じマテリアルを持つオブジェクトのみバッチングできるため、できるかぎり多くのテクスチャ/マテリアルを共有することが役に立ちます。

Static 関数

Combine StaticBatchingUtility.Combine prepares all children of the staticBatchRoot for static batching.