How to Download a List of image thru www and Save it in scriptable object for usage between scenes?
What I want is to download an image.(check, I know how to download images), now how to save it in a scriptable object for usage between scene? any example would be highly appreciated.
I tried doing
public List MyAvatars In scriptable objects but for it to work i have to use sprite.create in the function where i am downloading images from web. That i dont want to do cuz its expensive.
Before you move forward with this idea, I want to just make sure you’re aware that ScriptableObjects cannot store data between runs of your game. As in, if the user closes the game and reopens it, changes you made to any ScriptableObjects will not persist.
So this would just be a measure for while the game is running, and therefore it doesn’t make a huge amount of sense to use a ScriptableObject for this, as you gain nothing. Were you aware of that?
Yes I was aware of that. I dont want to store the data on the device. I was very sleepy when i wrote the question.
what I want is basically to develop a leaderboard for friends of player(facebook friends). So for that I need to download the the facebook Friends avatars and hold them somewhere for usage, As my leaderboard is in a separate scene I dont want to download the images each time the user opens the Leaderboard scene.
so I thought Scriptable object is good to hold all the information about the friends i.e names, score,avatarUrls, Sprites(or byte[ ],or Texture2d),countrycode.
I tried using List<byte[ ]> FriendsAvatars_bytes; in SObject. But it was me null reference each time i tried to use it in other scripts.
The main logic behind this is to actually hold all the friends info while the game is being played in Scriptable object, So that I dont have to download the images each time I open the leaderboard scene.