When a Ugui object is created, the canvas object is automatically created as the root node of all Ugui. The object has a canvas script , render mode options:
- Screen Space-overlay: All the UI will work and display even if there is no camera available in the scene. And any game object that is not a UI element cannot be obscured by UI elements (regardless of how the non-UI object is positioned).
- Screen Space-camera: A camera can be passed in to specify which camera renders all UI elements under the canvas object. You can specify the distance from the UI to the camera, adjust the distance, and other non-UI elements can precede or follow the UI element.
- World Space: This canvas object acts as a flat canvas in the scene and can be arbitrarily adjusted for position, rotation, and so on.
Canvas scaler script on canvas object:
- UI scale Mode
- Constant Pixel Size: Fixed by pixel. The UI element size is the same regardless of how the screen size changes.
- Scales with screens size: Commonly used, automatically scaled by screen size, which needs to be filled in at which resolution the UI is designed.
- Scale Factor: The zoom multiplier of all UI elements under the canvas object. Display dimensions = monitor panel dimensions * multiples.
- Reference Pixels Per unit:1 Meter has the number of pixels, the default of 100.
"Unity Notes" about Ugui's root node canvas