if GUI:Win_IsNotNull(ui.lv) then
GUI:Text_setString(ui.Text_1,level)
end我要把上这个挂在lib:left_move_to_fadeout("image_2","res/yidalu/zhuansheng4.0/zhuansheng tup.png",0.2,2,0.2,function()
end)
SL:ScheduleOnce(function()
local to
根据浮生梦老师前端课程内容,我来帮你分析这段代码。
首先,你第一行代码有语法错误,`GUI:Win_IsNotNull`函数在课程中并不存在,正确的函数应该是`GUI:Win_IsNull`。你需要判断组件是否为空,应该用:
```lua
if not GUI:Win_IsNull(ui.lv) then
GUI:Text_setString(ui.Text_1, level)
end
```
关于你想要在`lib:left_move_to_fadeout`函数完成后执行特效的代码,可以这样写:
```lua
lib:left_move_to_fadeout("image_2", "res/yidalu/zhuansheng4.0/zhuansheng tup.png", 0.2, 2, 0.2, function()
-- 当动画完成后执行
local topLayer = GUI:Attach_UITop()
local image = GUI:getChildByName(topLayer, "image_2")
if image and not GUI:Win_IsNull(image) then
local effect = GUI:Effect_Create(
image,
"eff_86416",
250,
200,
0,
86416
)
if effect and not GUI:Win_IsNull(effect) then
GUI:Effect_addOnCompleteEvent(effect, function()
GUI:removeFromParent(effect)
end)
end
end
end)
```
注意:`lib:left_move_to_fadeout`这个函数在课程中没有找到,可能是你自己创建的自定义函数,你需要确保这个函数确实存在并能正常工作。
另外提醒一下,`GUI:Attach_UITop()`这个函数在课程中也没有找到,你需要确认这个函数是否可用。如果不可用,你可能需要使用其他方式来获取顶层节点。
如果你还有不明白的地方,随时可以问我!