diff --git a/GooglePlayInstant/Editor/QuickDeploy/LoadingScreenGenerator.cs b/GooglePlayInstant/Editor/QuickDeploy/LoadingScreenGenerator.cs index 19caaac..a9d0e01 100644 --- a/GooglePlayInstant/Editor/QuickDeploy/LoadingScreenGenerator.cs +++ b/GooglePlayInstant/Editor/QuickDeploy/LoadingScreenGenerator.cs @@ -227,6 +227,13 @@ private static Vector2 GetPreImportTextureDimensions(Texture2D texture) throw new ArgumentException("The provided texture must be associated with an asset"); } + // If the asset path isn't accessible, we default to using the texture's dimensions + // This occurs if the provided texture is included with the Unity Editor. + if (!File.Exists(texturePath)) + { + return new Vector2(texture.width, texture.height); + } + // Load the image from disk then return its width and height. var imageBytes = File.ReadAllBytes(texturePath); var tempTexture = new Texture2D(1, 1); @@ -248,12 +255,12 @@ public static T FindAssetByFilter(string searchFilter) where T : UnityEngine. if (foundGuids.Length == 0) { - throw new Exception("Failed to find any assets that match: "+searchFilter); + throw new Exception("Failed to find any assets that match: " + searchFilter); } if (foundGuids.Length > 1) { - throw new Exception("Found multiple assets that match: "+searchFilter); + throw new Exception("Found multiple assets that match: " + searchFilter); } string path = AssetDatabase.GUIDToAssetPath(foundGuids[0]);