Пример #1
0
        public static AssetCacheData LoadAssetAtGUIDAndLocalID(string guid, long localID)
        {
            if (guid == null)
            {
                // null‚ÍEmpty‚ÅŠÛ‚ß‚é
                guid = string.Empty;
            }
            var cache = GetCache(guid, localID);

            if (cache != null)
            {
                return(cache);
            }

            cache = new AssetCacheData();
            if (guid.IsEmpty())
            {
            }
            else
            {
                var result = localID == 0 ? guid.LoadAsset() : AssetDatabaseUtils.LoadAssetAtGUIDAndLocalID(guid, localID);
                cache.unityObject = result;
                if (result == null)
                {
                    cache.missing = true;
                }
            }
            SetCache(guid, localID, cache);
            return(cache);
        }
Пример #2
0
        static void SetCache(string guid, long localID, AssetCacheData data)
        {
            var table = (AssetCacheTable)s_cacheAssets[guid];

            if (table == null)
            {
                table = new AssetCacheTable();
                s_cacheAssets.Add(guid, table);
            }
            table[localID] = data;
        }