處理Assetbundle依賴關係時想到的一道題

2022-09-05 17:15:08 字數 374 閱讀 3620

在處理unit3d的assetbundle依賴關係的時候,想到了一道有趣的題目:

給定一堆資料,例如, b = , c = , d = , e = }, 先判斷依賴關係,例如a包含b, e包含b, e包含c, 然後分組,能包含的可以分為同一組,例如a(b), d, e(c), 求分組的方案以及最優的方案?

這道題的答案其實很簡單,分組方案有兩種

這道題裡並沒有最優的方案,或者這兩種都算是最優方案也可以。

而對於十幾個相互包含的assetbundle,利用什麼演算法能夠得到最優解(使得最後打出的assetbundle數量最少),則是困擾我的地方,我並沒仔細去考慮這個演算法,而僅僅通過第一次碰見就處理這種方法來解決這種問題(得到的最終assetbundle數量肯定不是最少的)。

讀取AssetBundle依賴關係載入模型

一 讀取assetbundle依賴關係檔案 title assetbundle簡單框架 專案 輔助類 讀取assetbundle 依賴關係清單檔案。windows.manifest description 功能 author liuguozhu date 2017.10 modify using s...

Assetbundle的記憶體處理

那麼下面就舉乙個assetbundle的例子 assetbundle的記憶體處理 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ienumerator downloadandcache memory is freed from the w...

Spring處理迴圈依賴

什麼是迴圈依賴?a類注入b b注入c c注入a 形成了乙個依賴環 直接上spring原始碼 boolean earlysingletonexposure mbd.issingleton this allowcircularreferences issingletoncurrentlyincreati...