Esempio n. 1
0
        public Object GetPreload(string index)
        {
            if (assetPack == null)
            {
                return(null);
            }

            return(assetPack.GetAsset(index));
        }
        public static UnityObject GetAsset(string guid, long fileId, AssetPack assetPack)
        {
#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                var asset = GetAsset(guid, fileId);
                if (asset != null)
                {
                    return(asset);
                }

                Debug.LogWarning("Cannot find a local asset with " + guid + ". Falling back to asset pack.");
            }
#endif

            if (assetPack == null)
            {
                Debug.LogWarning("Cannot import asset with guid: " + guid + " and no asset pack");
                return(null);
            }

            return(assetPack.GetAsset(guid, fileId));
        }