Home
  • English
  • 中文
Home
  • English
  • 中文
  • Get Started

    • Install
    • Hello LGUI
    • Custom Button
    • Use custom font
    • Prefab workflow
    • Interaction
    • Button from scratch
  • Sample Projects

    • Sample Projects
  • Prefab Workflow

    • LGUI Prefab
    • PrefabEditor
    • LGUILifeCycleBehaviour
    • LGUIPrefabInterface
  • Rendering

    • LGUICanvas
    • Screen Space Overlay
    • World Space - UE Renderer
    • World Space - LGUI Renderer
    • LGUI render flow
    • UICanvasGroup
  • Visual Components

    • UIText
    • UIEffect
    • TextAnimation
    • UIBackgroundBlur
    • UIBackgroundPixelate
  • Events

    • LGUIEventDelegate
    • LGUIEventSystem
  • Interaction Components

    • UISelectable component
  • Layout

    • Basic Layout
    • Auto Layout
  • Tween Animation

    • LTween
    • Use LTween for UI element
  • Performance

    • LGUI Stat
  • ReleaseNotes

    • LGUI 3.x
    • LGUI 2.x
  • FAQ

    • Why use prefab?
    • Update project from LGUI2 to LGUI3
    • Project 3d world position to LGUI's screen 2d position
    • Deproject LGUI's screen position to world
    • Use custom material for UI elements
    • Disable interaction component
    • Find Child by DisplayName
    • Get actor or component inside prefab
    • Anti-aliasing

Why use prefab?

Logic handled by script, data and information mouting handled by prefab

Borrowing a famous quote from MaxwellGeng's answer in this post: Prefab比起BP,最根本的关系在于:心里有点B数,知道自己是干啥的. For a detailed comparison, you can read the post.
Therefore, in the prefab workflow, scripts (c++ and blueprints) are only responsible for processing logic, and prefabs are responsible for mounting information.

Execute order of Awake and Tick are predictable

LGUIPrefab creates Actors in this order when loading: they are created from top to bottom according to the Outliner sorting, so the root object is created first; the Outliner is sorted by the name of the ActorLabel by default (UI objects are sorted according to the HierarchyIndex). Because the order in which Actors are created is controllable, Awake and Tick are executed in the order in which they are created.

Last Updated:
Contributors: lf2007hf
Next
Update project from LGUI2 to LGUI3