Ejemplo n.º 1
0
 static int CancelCreateAssetAsync(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
         ResourceUtil.CancelCreateAssetAsync(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 2
0
    void CreateAsset()
    {
        int requestId = ResourceUtil.CreateAssetAsync(pname, (Object asset, int tRequestId) =>
        {
            Debug.Log("==========================load asset success " + asset);
            // 卸载
            if (createState == CreateState.Destory)
            {
                ResourceUtil.DestoryAsset(pname);
            }
        });

        // 取消加载
        if (createState == CreateState.Cancel)
        {
            ResourceUtil.CancelCreateAssetAsync(requestId);
        }
    }