コード例 #1
0
        /// <summary>
        /// 解析Lua脚本
        /// </summary>
        /// <returns>返回值</returns>
        /// <param name="script">Lua脚本</param>
        public LuaValue evalScript(string script)
        {
            IntPtr resultPtr = IntPtr.Zero;
            int    size      = NativeUtils.evalScript(_nativeObjectId, script, out resultPtr);

            return(LuaObjectDecoder.DecodeObject(resultPtr, size) as LuaValue);
        }
コード例 #2
0
        /// <summary>
        /// 解析Lua脚本
        /// </summary>
        /// <returns>返回值.</returns>
        /// <param name="script">脚本内容.</param>
        /// <param name="scriptController">脚本控制器.</param>
        public LuaValue evalScript(string script, LuaScriptController scriptController)
        {
            IntPtr resultPtr = IntPtr.Zero;

            int scriptControllerId = 0;

            if (scriptController != null)
            {
                scriptControllerId = scriptController.objectId;
            }

            int size = NativeUtils.evalScript(_nativeObjectId, script, scriptControllerId, out resultPtr);

            return(LuaObjectDecoder.DecodeObject(resultPtr, size, this) as LuaValue);
        }