Unity load data from server in JSON format ,load images

  Рет қаралды 25,701

Hamza Herbou

Hamza Herbou

Күн бұрын

How to load data from server in JSON format:
[
{
"Name":"......",
"Description":".....",
"IconUrl":"......"
},
{
"Name":"......",
"Description":".....",
"IconUrl":"......"
},
{
"Name":"......",
"Description":".....",
"IconUrl":"......"
}
...
..
]
Package & Code:
github.com/her...

Пікірлер: 77
@akobirmusaev5479
@akobirmusaev5479 3 жыл бұрын
It was perfect video, It was better than I waited. We wait new videos about API more. Thank u
@vedantsharma3589
@vedantsharma3589 Жыл бұрын
dude i am getting an error in the jsonhelper script saying json parsing value invalid on this line : Wrapper w = UnityEngine.JsonUtility.FromJson (newJson); please help me fast
@aubsurf
@aubsurf Жыл бұрын
Hey, thank you so much for the tuttos. I have a ques. can I chage the localhost to google drive ? thank u
@evgenykutepov2303
@evgenykutepov2303 4 жыл бұрын
Thanks bro, exactly what I need. I also decided to add a checking for Internet available through the Application.internetReachability class, SimpleDiskUtils.DiskUtils free space checking, and caching.
@examination4088
@examination4088 3 жыл бұрын
How are you caching the images? Could you please share the code?
@evgenykutepov2303
@evgenykutepov2303 3 жыл бұрын
@@examination4088 download a picture, then store it in a variable. when trying to load a new one, just take it from the variable
@herbou
@herbou 3 жыл бұрын
Download and cache images: kzbin.info/www/bejne/joqVhWWuq86gZrM
@AffalterbachV8
@AffalterbachV8 2 жыл бұрын
Thanks a lot for that tutorial! I have a question: I got a Prefab which gets created from that JSON and it works so far, but my prefab is made of an Panel and on that panel I have my Text, ... and when running the game, it creates the clones of my prefab which is correct, but it also clones the Panel, so my GameObject has 2 panels in it. How can I fix that?
@nick5075
@nick5075 3 жыл бұрын
Hello! Would this also work if I want to download Sprites for (let's say) items on my game? In my case, they are a lot and I don't want them to make my APK's size larger.
@monoo9508
@monoo9508 2 жыл бұрын
How could I load an inventory from JSON?
@moadigitalart
@moadigitalart 2 жыл бұрын
great tutorial...it help me. what if more than 1 scene and the content is different. if you duplicate the script it will show "global namespace:: ButtonExtention" how to overcome this
@gamepass505
@gamepass505 4 жыл бұрын
Nice video! Exactly what I was looking for
@ammar0345
@ammar0345 4 жыл бұрын
Will this required to make an api form on web first then we can access the data only? if i want to deploy the data on website.
@herbou
@herbou 4 жыл бұрын
Yes 😊
@ammar0345
@ammar0345 4 жыл бұрын
Hamza Herbou thanks. Do wordpress offer such hosting? I mean api server hosting
@Sillymonkeies
@Sillymonkeies 2 жыл бұрын
Very cool! Thank you
@sakineinoussa2186
@sakineinoussa2186 3 жыл бұрын
I like your tutorials it helps me a lot, I have a question, how to use the same way to load a JSON file and open categories and subcategories on each click of a button, for each button to open the content of its category (these subcategories), and go back by going from one category to another without leaving the stage; please help me, thank you
@nabilhamouda1472
@nabilhamouda1472 3 жыл бұрын
Hi , i want the same thing too,,, did you find a solution?😅
@Santanu_Pal
@Santanu_Pal 4 жыл бұрын
how to connect online server? Does this scrip will run for that? Or we need to use some specific php or json file? How to setup those files?
@herbou
@herbou 4 жыл бұрын
What do you need exactly , Get data? Or save data in a server ? ... Can you be more specific
@Santanu_Pal
@Santanu_Pal 4 жыл бұрын
@@herbou Looking for the process where we can save data by Sql (or similar) to online server and to access same date by other user.
@seifmustafa2004
@seifmustafa2004 4 жыл бұрын
hey hamza , Great Video , I'm Just stuck in a little problem over here , whenever I ran the code on a local json file [not on a server or local host] it the function returns null, any thoughts ? the file ->> [ { "ScenarioName":"Light ON", "icon":0, "Function":[1,0,2], "Channel":[0,1,2,3], "Device":[1] }, { "ScenarioName":"Light off", "icon":0, "Function":[1,0,2], "Channel":[0,1,2,3], "Device":[1] } ]
@herbou
@herbou 4 жыл бұрын
share the c# script to help you
@seifmustafa2004
@seifmustafa2004 4 жыл бұрын
@@herbou it worked , turned out i had to tweak the script a bit to be able to save them in a list
@wasim4858
@wasim4858 4 жыл бұрын
Always produce valuable learning videos thank you so much bro I really appreciate your hard work.. please make a video about detail page as well when click on any item of that data detail page will open.
@herbou
@herbou 4 жыл бұрын
add GameUrl to the json . And add it also to the C# script struct Game{ ... public string GameUrl; } .. .. OnItemClick(int index){ Application.OpenUrl(allGames[i].GameUrl); }
@wasim4858
@wasim4858 4 жыл бұрын
@@herbou thanks bro
@magnetopia4447
@magnetopia4447 3 жыл бұрын
exactly what i need, thanks alot
@examination4088
@examination4088 3 жыл бұрын
How can I use this with Davinci? I just want to cache the images in the project.
@herbou
@herbou 3 жыл бұрын
watch the Davinci tutorial that i've made
@md.abuyousuf6225
@md.abuyousuf6225 4 жыл бұрын
Great video! are those different images able to load different scenes in the game from json? can you please help with the code.
@herbou
@herbou 4 жыл бұрын
Search for Asset bundles and how to download scene from a server using Asset bundls
@noureddineel890
@noureddineel890 3 жыл бұрын
mrc khoya lay7fdak
@aldhiraqiswandri251
@aldhiraqiswandri251 3 жыл бұрын
please help me, how after click go to link playstore?
@herbou
@herbou 3 жыл бұрын
## First: add StoreUrl field in your JSON file: [ { "Name" : "...", "Description" : "...", "IconUrl" : "..." , "StoreUrl" : "..." }, { "Name" : "...", "Description" : "...", "IconUrl" : "..." , "StoreUrl" : "..." }, { "Name" : "...", "Description" : "...", "IconUrl" : "..." , "StoreUrl" : "..." } ] ## Then go to Demo.cs and add it to Game struct: [Serializable] public struct Game { public string Name; public string Description; public Sprite Icon; public string IconUrl; public string StoreUrl; } ## Then go to ItemClicked function: void ItemClicked (int itemIndex){ Application.OpenURL(allGames [itemIndex].StoreUrl); }
@aldhiraqiswandri251
@aldhiraqiswandri251 3 жыл бұрын
@@herbou big thanks... and i also how to make UI responesive with scroll for many items
@nabilhamouda1472
@nabilhamouda1472 3 жыл бұрын
Hello, thank you for interesting Video... just I m New in unity and I have a project that I m making and I stucked how can I load my data(text and video) in a game object in unity !:( ... I made a textmeshpro component and I want to load the text which I want from my azure blob storage ..... I have different Texts which I want to load them...can you help me ?
@herbou
@herbou 3 жыл бұрын
did you store data as json in azure storage?
@nabilhamouda1472
@nabilhamouda1472 3 жыл бұрын
@@herbou the problem that first time I ll use json so i have no idea actually how to write for my game object and how to make it work at first in unity or it s not important at first ? I need an example at least like I have a Tmeshpro object and how write a text in json like " the World is beautiful" and call it from azure. Thank you so much
@herbou
@herbou 3 жыл бұрын
if you want just one text you can just put that text in a file (file.txt) and acces it from unity using UnityWebRequest .. as i did in this tutorial pastebin.com/1jNpYKua
@nabilhamouda1472
@nabilhamouda1472 3 жыл бұрын
@@herbou thank you for your respond really and I ll try it as an example first but in my project I need more than one text and one video .... I mean in one textmeshpro object load the Texts .... first Text then I click on Button next so appear the other ........ I ll watch your Video and if I found a problem ...is it ok for you to ask you?
@herbou
@herbou 3 жыл бұрын
okay . but try this one first
@aldikamu2432
@aldikamu2432 3 жыл бұрын
It is work now???
@herbou
@herbou 3 жыл бұрын
yes
@saifgames2468
@saifgames2468 4 жыл бұрын
Amazing :D
@ShadowChaos
@ShadowChaos 4 жыл бұрын
can u make a video of a game main menu like Play ,Options,Quit fully functional
@karmunlee7580
@karmunlee7580 4 жыл бұрын
Hi, Mr.Hamza, I love this video. But can you please make a tutorial or a script that is load data from the server into the "text" on UI in Unity instead of a button? I want to display the word from the JSON file as a text on UI. I really need this help. Thank you so much.
@herbou
@herbou 3 жыл бұрын
if you undersand this tutorial then it's the same thing . just give it a try 😊
@NtaGot
@NtaGot 3 жыл бұрын
can you make a video with loading 3d models?
@Chofpress
@Chofpress 4 жыл бұрын
Thanks bro can you make a video about json admob control please !
@sekmanimohamedamine1237
@sekmanimohamedamine1237 3 жыл бұрын
like + subscribe, from Tunisia Your video is so helpful
@herbou
@herbou 3 жыл бұрын
welcome 🇲🇦
@lorenbeall147
@lorenbeall147 4 жыл бұрын
very good content bro, can you suggest me some course to begin in unity developpement; thank you very much
@herbou
@herbou 4 жыл бұрын
The best place is unity documentations and forums ..and a lot of practicing
@lorenbeall147
@lorenbeall147 4 жыл бұрын
@@herbou ok brother. thanks
@helenawilsena5821
@helenawilsena5821 4 жыл бұрын
#Hamza You a great Game dev i had ever seen in KZbin. I love your tutorial. I'm beginner Android dev in Unity. I need your help. I need Admob Ads C# Script Auto load and display Banner ads. And when click one buttons then Auto load and show intastial ads. Please can you make a tutorial on it. Or give me the scripts please Hamza.
@herbou
@herbou 4 жыл бұрын
I already made admob ads serie in my chanel. Banner, Interstitial, Reward, Native.
@helenawilsena5821
@helenawilsena5821 4 жыл бұрын
@@herbou Thanks Hamza i'll checking out
@CyrusAmirabadi
@CyrusAmirabadi 3 жыл бұрын
@@herbou I need to use Admob via a Json remote config (get Admob tokens from Json) and I don't want to use Firebase for some reasons. Can you please make a tutorial on it or show me how?
@herbou
@herbou 3 жыл бұрын
you can use remote config . and use strings to store Ad IDs kzbin.info/www/bejne/Z2XRm3t_aah6naM
@CyrusAmirabadi
@CyrusAmirabadi 3 жыл бұрын
@@herbou OK Thanks. Let me try it
@davidmason7519
@davidmason7519 4 жыл бұрын
very usefull and very amazing video.i love all your videos. but i have a question and that is i host my images using dropbox and also i made a json file which i also hosted using dropbox. and when i follow your codes all things are worked perfectly.but now i want to change my json file directly but i cannot edit the json file.here is the link of that json file : dl.dropboxusercontent.com/s/jt556c5nrqnchwk/Games.json?dl=0 you can check it.so basically i dont have any idea for update that json file bcz in real game when i release a new game then i must change some games and its images without update my whole game. so please can you tell me if you know anything.
@herbou
@herbou 4 жыл бұрын
You need to put tge json file in a Server so tgat you can easily edit ut or add more apps... I guess you can't edit files content in dropbox Try google drive
@davidmason7519
@davidmason7519 4 жыл бұрын
@@herbou but when i upload a json file in drive i am able to edit it but when i get sharable link and paste it into the code json parse error was appeared. so i know that without hosting we cannot do this so that is my question that how can i edit hosted file.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 719 М.
小天使和小丑太会演了!#小丑#天使#家庭#搞笑
00:25
家庭搞笑日记
Рет қаралды 57 МЛН
World‘s Strongest Man VS Apple
01:00
Browney
Рет қаралды 56 МЛН
MY HEIGHT vs MrBEAST CREW 🙈📏
00:22
Celine Dept
Рет қаралды 17 МЛН
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 30 МЛН
Локальный сервер для проектов и тестирования
12:58
Михаил Непомнящий
Рет қаралды 43 М.
JSON IN C# - Downloading Data and Making Objects From It
24:10
tutorialsEU
Рет қаралды 40 М.
Download Data/Images from inside Unity (HTTP WebRequest)
16:05
Code Monkey
Рет қаралды 38 М.
Scroll View. Пошаговое создание. Unity3D
12:03
Unity Developer
Рет қаралды 11 М.
MP3 CDs: a hybrid "format" that never existed, yet was surprisingly common
34:18
Technology Connections
Рет қаралды 171 М.
Using JSON IN C#! Serialization & Deserialization made easy!
14:47
tutorialsEU - C#
Рет қаралды 32 М.
SAVE & LOAD SYSTEM in Unity
18:20
Brackeys
Рет қаралды 1,1 МЛН
Unity using JSON from URL - EASY
25:15
Online Code Coaching
Рет қаралды 26 М.
小天使和小丑太会演了!#小丑#天使#家庭#搞笑
00:25
家庭搞笑日记
Рет қаралды 57 МЛН