去掉UIRaycastNoDraw组件,这个组件会造成:

MissingComponentException: There is no 'CanvasRenderer' attached to the "btn" game object, but a script is trying to access it.
This commit is contained in:
fatiao 2025-03-09 12:36:37 +08:00
parent 4db90bfa24
commit 1bf43e95d0

View File

@ -233,7 +233,7 @@ function UIFuncUnlockMgr:NormalLock(wnd, data, target, result, key, guideState,
local rectTrans = go:GetOrAddComponent(Enum.TypeInfo.RectTransform)
rectTrans.sizeDelta = targetSize
go:GetOrAddComponent(Enum.TypeInfo.UIRaycastNoDraw)
--go:GetOrAddComponent(Enum.TypeInfo.UIRaycastNoDraw)
go:GetOrAddComponent(Enum.TypeInfo.Button)
end
if lockBtn == nil and go ~= nil then
@ -251,7 +251,7 @@ function UIFuncUnlockMgr:NormalLock(wnd, data, target, result, key, guideState,
local rectTrans = go:GetOrAddComponent(Enum.TypeInfo.RectTransform)
rectTrans.sizeDelta = targetSize
go:GetOrAddComponent(Enum.TypeInfo.UIRaycastNoDraw)
--go:GetOrAddComponent(Enum.TypeInfo.UIRaycastNoDraw)
go:GetOrAddComponent(Enum.TypeInfo.Button)
end
if lockBubble == nil and go ~= nil then