We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
local function OnCreate(self, relative_order) base.OnCreate(self) -- Unity侧原生组件 self.unity_canvas = nil self.unity_graphic_raycaster = nil -- canvas self.unity_canvas = UIUtil.FindComponent(self.transform, typeof(CS.UnityEngine.Canvas)) if IsNull(self.unity_canvas) then self.unity_canvas = self.gameObject:AddComponent(typeof(CS.UnityEngine.Canvas)) end self.unity_canvas.overrideSorting = true self.unity_canvas.sortingLayerName = SortingLayerNames.UI -- raycaster self.unity_graphic_raycaster = UIUtil.FindComponent(self.transform, typeof(CS.UnityEngine.UI.GraphicRaycaster)) if IsNull(self.unity_graphic_raycaster) then self.unity_graphic_raycaster = self.gameObject:AddComponent(typeof(CS.UnityEngine.UI.GraphicRaycaster)) end -- order self.relative_order = relative_order or 0 self:SetOrder(self.relative_order) end
若self.transform不存在Canvas组件,但是子物体存在Canvas组件,则这条代码self.unity_canvas = UIUtil.FindComponent(self.transform, typeof(CS.UnityEngine.Canvas))获取到的unity_canvas为子物体的Canvas,并未在当前self.transform上添加组件Canvas。GraphicRaycaster组件同理。 不知是否为有意为之。
The text was updated successfully, but these errors were encountered:
是一个bug,获取子节点Canvas没有意义
Sorry, something went wrong.
No branches or pull requests
若self.transform不存在Canvas组件,但是子物体存在Canvas组件,则这条代码self.unity_canvas = UIUtil.FindComponent(self.transform, typeof(CS.UnityEngine.Canvas))获取到的unity_canvas为子物体的Canvas,并未在当前self.transform上添加组件Canvas。GraphicRaycaster组件同理。
不知是否为有意为之。
The text was updated successfully, but these errors were encountered: