コード例 #1
0
        public void OnSetWallpaperFromFilePath()
        {
            AGGallery.PickImageFromGallery(
                selectedImage =>
            {
                var imageTexture2D = selectedImage.LoadTexture2D();

                string msg = string.Format("{0} was loaded from gallery with size {1}x{2}",
                                           selectedImage.OriginalPath, imageTexture2D.width, imageTexture2D.height);
                AGUIMisc.ShowToast(msg);
                Debug.Log(msg);
                AGWallpaperManager.SetWallpaper(selectedImage.OriginalPath);

                // Clean up
                Resources.UnloadUnusedAssets();
            },
                errorMessage => AGUIMisc.ShowToast("Cancelled picking image from gallery: " + errorMessage));
        }
コード例 #2
0
        public void OnSetLockScreenWallpaperFromTexture()
        {
            var rect = new AndroidRect(0, 0, 400, 400);

            AGWallpaperManager.SetWallpaper(wallpaperTexture, rect, true, AGWallpaperManager.WallpaperType.Lock);
        }
コード例 #3
0
 public void OnSetWallpaperFromTexture()
 {
     AGWallpaperManager.SetWallpaper(wallpaperTexture, null, true, AGWallpaperManager.WallpaperType.System);
 }
コード例 #4
0
 public void OnSetWallpaperFromTexture()
 {
     AGWallpaperManager.SetWallpaper(wallpaperTexture);
 }