Example #1
0
        private static AssetInfo ConvertLocationToAssetInfo(string location, System.Type assetType)
        {
            DebugCheckLocation(location);
            string     assetPath  = _locationServices.ConvertLocationToAssetPath(location);
            PatchAsset patchAsset = _bundleServices.TryGetPatchAsset(assetPath);

            if (patchAsset != null)
            {
                AssetInfo assetInfo = new AssetInfo(patchAsset, assetType);
                return(assetInfo);
            }
            else
            {
                string error;
                if (string.IsNullOrEmpty(location))
                {
                    error = $"The location is null or empty !";
                }
                else
                {
                    error = $"The location is invalid : {location}";
                }
                YooLogger.Error(error);
                AssetInfo assetInfo = new AssetInfo(error);
                return(assetInfo);
            }
        }