예제 #1
0
    public bool Rebuild(Guid taskID, U3DAssetDBRebuildTask.Result res)
    {
        if (!taskID.Equals(rebuildTaskID))
        {
            return(false);
        }

        assetTable           = res.assetTable;
        assetReferencedTable = res.assetReferencedTable;
        unUsedAssets         = res.unUsedAssets;
        rebuildTaskID        = Guid.Empty;
        //更新数据库时间
        dbUpdateTime = DateTime.Now.ToLocalTime().ToString();

        //标记已经破损的资源
        foreach (var corruptedId in corruptedAssets)
        {
            U3DAssetInfo info = null;
            if (assetTable.TryGetValue(corruptedId, out info))
            {
                ResourceManageToolUtility.MarkAssetCorrupted(ref info);
            }
        }
        corruptedAssets.Clear();
        Save();

        return(true);
    }
예제 #2
0
    public bool UpdateAssetDatabase(Guid taskID, object resultObj)
    {
        bool ret = false;

        U3DAssetDBRebuildTask.Result rs = resultObj as U3DAssetDBRebuildTask.Result;
        ret = U3DAssetDB.GetInstance().Rebuild(taskID, rs);
        _UpdateAllAssetList();
        _NotifyAssetDatabaseUpdate();

        if (ret)
        {
            state = State.STATE_BUILD;
            _NotifyAssetDatabaseStateChange();
        }

        return(ret);
    }