Rebuild & Scheduling

ForceRebuild

public void ForceRebuild(bool synchronous = true)
{
    if (synchronous) InternalRebuildMeasured();
    else             StartCoroutine(AsyncRebuild(null));
}

Purpose: Rebuild the decal immediately. Can block this frame (synchronous) or run as a coroutine to avoid UI stalls. Parameters:

  • synchronoustrue = block; false = run AsyncRebuild. Returns: void Notes: Prefer async if you expect large meshes or frequent rebuilds.


AsyncRebuild

public IEnumerator AsyncRebuild(Action<float> onProgress)
{
    yield return null;                   // allow one frame for UI responsiveness
    InternalRebuildMeasured(onProgress);
}

Purpose: Coroutine-based rebuild; yields at least once and can report progress [0..1]. Parameters: onProgress (nullable) — receives progress updates; called with 1f at completion. Returns: IEnumerator (start via StartCoroutine). Notes: Great for editor tools and runtime UX when you don’t want input hitches.


Last updated