Lua 的If Else用法




function GetValue()
    local a=channel.GetChild(0):GetValue()
	local b=channel.GetChild(1):GetValue()
	local c=channel.GetChild(2):GetValue()
	local d=channel.GetChild(3):GetValue()
    local val=0

	if c<1 and a=d and a>b then
		val=0
	else
		val=a-b
	end

	return val
end


你可能感兴趣的:(虚拟现实,Lua脚本)