Breakroom is now Sinewave Campus. Book a meeting

SGraphicRaycaster

客户端组件
在此类中Raycast
  1. 函数
  2. Raycast
  3. 属性
  4. SortOrderPriority
  5. RenderOrderPriority
  6. GameObject
成员 4
函数RaycastPerform the raycast against the list of graphics associated with the Canvas and returns first UI raycast result.
属性SortOrderPriorityPriority of the raycaster based upon render orderPriority of the raycaster based upon sort order.
属性RenderOrderPriorityPriority of the raycaster based upon render order.
属性GameObject–

函数​

Raycast​

Perform the raycast against the list of graphics associated with the Canvas and returns first UI raycast result.

返回值

SUIRaycastResult

示例

Lua
raycastResult = Space.Host.ExecutingObject.GraphicRaycaster.Raycast()
Lua
local trans = Space.Host.ExecutingObject
local canvas = Space.Host.GetReference("Canvas")
local gr = canvas.GraphicRaycaster
function Update()
local raycast = gr.Raycast()
Space.Log(raycast.ToString())
end
trans.OnUpdate(Update)

属性​

SortOrderPriority只读​

int SortOrderPriority {get; }

Priority of the raycaster based upon render orderPriority of the raycaster based upon sort order.

示例

Lua
Space.Host.ExecutingObject.GraphicRaycaster.SortOrderPriority= 1

RenderOrderPriority只读​

int RenderOrderPriority {get; }

Priority of the raycaster based upon render order.

示例

Lua
Space.Host.ExecutingObject.GraphicRaycaster.RenderOrderPriority = 1

GameObject只读​

SGameObject GameObject {get; }

示例

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