Breakroom is now Sinewave Campus. Book a meeting

SUICanvas

客户端组件
在此类中IsRootCanvas
  1. 属性
  2. IsRootCanvas
  3. ScaleFactor
  4. ReferencePixelsPerUnit
  5. PixelPerfect
  6. PlaneDistance
  7. SortingOrder
  8. TargetDisplay
  9. NormalizedSortingGridSize
  10. GameObject
成员 9
属性IsRootCanvasThe avoidance radius for the agent.
属性ScaleFactorScales all UI elements in the Canvas by this factor.
属性ReferencePixelsPerUnitIf a sprite has this "Pixels Per Unit" setting, then one pixel in the sprite will cover one unit in the UI.
属性PixelPerfectShould the UI be rendered without antialiasing for precision?
属性PlaneDistanceThe distance at which the UI plane should be placed in front of the camera.
属性SortingOrderCanvas' order within a sorting layer.
属性TargetDisplayFor Overlay mode, display index on which the UI canvas will appear.
属性NormalizedSortingGridSizeThe normalized grid size that the canvas will split the renderable area into.
属性GameObject–

属性​

IsRootCanvas只读​

bool IsRootCanvas {get; }

The avoidance radius for the agent.

示例

Lua
IsRootCanvas = Space.Host.ExecutingObject.UICanvas.IsRootCanvas

ScaleFactor​

float ScaleFactor {get; set; }

Scales all UI elements in the Canvas by this factor.

示例

Lua
Space.Host.ExecutingObject.UICanvas.ScaleFactor = 2.0

ReferencePixelsPerUnit​

float ReferencePixelsPerUnit {get; set; }

If a sprite has this "Pixels Per Unit" setting, then one pixel in the sprite will cover one unit in the UI.

示例

Lua
Space.Host.ExecutingObject.UICanvas.ReferencePixelsPerUnit = 50.0

PixelPerfect​

bool PixelPerfect {get; set; }

Should the UI be rendered without antialiasing for precision?

示例

Lua
Space.Host.ExecutingObject.UICanvas.PixelPerfect = true

PlaneDistance​

float PlaneDistance {get; set; }

The distance at which the UI plane should be placed in front of the camera.

示例

Lua
Space.Host.ExecutingObject.UICanvas.PlaneDistance = 2.0

SortingOrder​

int SortingOrder {get; set; }

Canvas' order within a sorting layer.

示例

Lua
Space.Host.ExecutingObject.UICanvas.SortingOrder = 2.0

TargetDisplay​

int TargetDisplay {get; set; }

For Overlay mode, display index on which the UI canvas will appear.

示例

Lua
Space.Host.ExecutingObject.UICanvas.TargetDisplay = 1

NormalizedSortingGridSize​

float NormalizedSortingGridSize {get; set; }

The normalized grid size that the canvas will split the renderable area into.

示例

Lua
Space.Host.ExecutingObject.UICanvas.NormalizedSortingGridSize = 5.0

GameObject只读​

SGameObject GameObject {get; }

示例

Lua
theGameObject = Space.Host.ExecutingObject.UICanvas.GameObject