Example #1
0
 static void fetchImage(Splash splash)
 {
     SplashApi.FetchSplashImage(CImageUtils.SplashImageUrl(splash.image)).Then(imageBytes => {
         File.WriteAllBytes(PATH + splash.image.GetHashCode(), imageBytes);
         var splashInfo = JsonConvert.SerializeObject(splash);
         PlayerPrefs.SetString(SplashInfoKey, splashInfo);
     });
 }
Example #2
0
        public static byte[] readImage()
        {
            if (image_bytes == null)
            {
                var splash = JsonConvert.DeserializeObject <Splash>(PlayerPrefs.GetString(SplashInfoKey));
                image_bytes = CImageUtils.readImage(PATH + splash.image.GetHashCode());
            }

            return(image_bytes);
        }