/**
* Load an lua file.
*
* @param string strFile - The file name without extension.
* @return bool - true if success, otherwise false.
*/
public bool DoFile(string strFile)
{
if (string.IsNullOrEmpty(strFile))
{
return(false);
}
// Try to do file.
try
{
// The lua file return the table itself.
object cChunk = YwLuaScriptMng.Instance.LuaSvr.luaState.doFile(strFile);
if ((null == cChunk) || !(cChunk is LuaTable))
{
return(false);
}
// Remember lua table.
m_cLuaTableOpt = new YwLuaTable((LuaTable)cChunk);
return(true);
}
catch (System.Exception e)
{
YwDebug.LogError(YwLuaSvr.FormatException(e));
}
return(false);
}