AudioAsset
Ease
FastString
FontAsset
NineSlice
PackedSprite
PackedSpriteID
RB
   HardwareSettings
   IRetroBlitGame
RBAsset
Rect2i
ShaderAsset
SoundReference
SpriteGrid
SpriteSheetAsset
TMXMapAsset
   TMXLayer
   TMXLayerLoadState
   TMXObject
   TMXObjectGroup
   TMXProperties
Vector2i

RB.BatchDebugEnable

Method  -  Static

public static void BatchDebugEnable(Color32 fontColor, Color32 backgroundColor)

Parameters

fontColor Color32 Font color to use
backgroundColor Color32 Background color to use

Returns

Nothing.

Description

RetroBlit batches as many drawing operations as it can before flushing them out to the GPU. The fewer the batches the faster the game will run. A batch can be flushed for a variety of reasons, such as:

  • Batch is full
  • Spritesheet has changed
  • Tilemap chunk drawn
  • End of frame
  • Clip region has changed
  • Offscreen target has changed
  • Post processing effect applied
  • Shader changed
  • Shader reset
  • RetroBlit had to internally change materials
  • RetroBlit had to internally change texture
The batch counts displayed by RB.BatchDebugEnable may assist in identifying inefficiencies, and in better grouping operations to cause the least amount of batches.

Example

void Update() {
    if (RB.KeyPressed(KeyCode.F12)) {
        RB.BatchDebugEnable(Color.white, Color.black);
    } else if (RB.KeyPressed(KeyCode.F11)) {
        RB.BatchDebugDisable();
    }
}

See Also

RB.BatchDebugDisable