鉴于Vizrt没有提供脚本什么调试功能,那么只能自己弄一个了。下面的DavidDebug是一个有文字的container。
dim debug_info =scene.findcontainer("DavidDebug").getchildcontainerbyindex(0)
dim debug_array as array[string]
sub oninit()
debug_array.clear()
end sub
sub setdebug(info as string)
dim debug=getparameterbool("debug")
dim temp=getTime(getcurrenttime())&" "&info
if debug_array.ubound<5 then
debug_array.push(temp)
else
debug_array.Erase(0)
debug_array.push(temp)
end if
if debug then
debug_info.geometry.text=cstr(getStringArray(debug_array))
end if
end sub
function getTime(dt as datetime) as string
getTime=cstr(dt.hour)&":"&cstr(dt.minute)&":"&cstr(dt.second)
end function
function getStringArray(arrStr as array[string]) as string
dim temp as string
for i=0 to arrStr.ubound
temp=temp&arrStr[i]&Chr(10)
next
getStringArray=temp
end function
sub OnInitParameters()
registerparameterbool("debug","Debug: ",false)
end sub