Unity热更新04-XLua调用C#-010-Lua调用C# Unity UI

GameObject = CS.UnityEngine.GameObject
UI = CS.UnityEngine.UI

local slider = GameObject.Find("Slider")
print(slider)
local sliderScript = slider:GetComponent(typeof(UI.Slider))
print(sliderScript)
sliderScript.onValueChanged:AddListener(function(f)
	print(f)
end)
posted @ 2020-10-29 13:13  UnitySir  阅读(284)  评论(0编辑  收藏  举报