BatchLoader
所有文档

          AR开放平台

          BatchLoader

          此类封装分步加载二次加载相关操作

          Public methods
          BatchLoader BatchLoaderDemo()
          BatchLoader Demo.
          void send_download_retry_msg()
          向上端发送重新下载的消息
          void user_confirm_download(string batch_id)
          设置用户同意重新下载的回调
          void user_refuse_download(string batch_id)
          设置用户拒绝重新下载的回调

          BatchLoaderDemo

          BatchLoaderDemo ()

          BatchLoader Demo示例.

          sample:  
          1. 在回调中如果ret为-1,表示包加载出问题,BatchLoader.send_download_retry_msg()发送消息重新尝试
          scene.on_batch_load_finish = function(id ,ret)
             if (id == 1 and ret == -1) then
                BatchLoader.send_download_retry_msg()
                return
             end
          
             if (id == 2 and ret == -1) then
                BatchLoader.send_download_retry_msg()
                return
             end
          end
          
          
          2.设定用户接收重新下载和拒绝重新下载的函数
          返回的batch_id格式为batch1 (一个资源包的情况)
          
          BatchLoader.user_confirm_download = function(batch_id)
             if (batch_id == 'batch1') then
                scene:load_batch(1)
             end
             io.write("user_confirm_download:"..batch_id)
          end
          
          BatchLoader.user_refuse_download = function(batch_id)
             io.write("user_refuse_download :"..batch_id)
          end

          send_download_retry_msg

          void send_download_retry_msg ()

          向上端发送重新下载的消息

          Parameters

          • camera_name | string:相机节点的名字
          sample:  
          BatchLoader.send_download_retry_msg()

          user_confirm_download

          void user_confirm_download (string batch_id)

          设置用户同意重新下载的回调

          Parameters

          • batch_id | string:分布资源包的名字
          sample:  
          BatchLoader.user_confirm_download = function(batch_id)
          if (batch_id == 'batch1') then
             scene:load_batch(1)
          end
          io.write("user_confirm_download:"..batch_id)
          end

          user_refuse_download

          void user_refuse_download (string batch_id)

          设置用户拒绝重新下载的回调

          Parameters

          • batch_id | string:分布资源包的名字
          sample:  
          BatchLoader.user_refuse_download = function(batch_id)
            io.write("user_refuse_download:"..batch_id)
          end
          上一篇
          BaiduActivity
          下一篇
          JsonHandler