Article Directory
1. Material preparation
1. Create an empty project, download resources from the store,
find an environment, find a character. The
character comes with a mobile script, just drag the prefab into it.
Now the villain is ready to move.
We also need a backpack UI panel.
2. UI panel construction
Start to build the backpack UI. The backpack is a panel, add a Text title, add a Panel with Grid Layou Group (for placing the grid), and add a description Text below.
Three. Json data read and write test
First add a Key to open and close the backpack,
add the Item class, add the JsonData that needs to be serialized,
add a Json data management (for reading and writing),
to test the reading and writing method. After
writing the test, format it on the beJson website (for easy modification)
Read test
Use unity's own JsonUtility.FromJson failed, it is recommended to use LitJson (download method: official website github download dll, put it into the Plugins folder (created
by yourself )) Use LitJson to read successfully
JsonUtility failed to read
4. The second way to download LitJson
You can also use the second method to download LitJson, which is also the recommended method. Download a Nuget plug-in:
https://github.com/GlitchEnzo/NuGetForUnity
Download and install it here to use, and it is also convenient to manage.
The next article will associate the obtained data with the UI panel. If it helps you, please like it