Make sure that you have installed Addressables and open window Addressables Groups:
Window > Asset Management > Addressables > Groups
If you are seeing this window first time you should see a button named “Create Addressables Settings”. Click it.
Then import all files into your project.
After the import process completition you should see a bunch of new groups in window Addressables Groups prefixed with “DA -”.
Done! You are all set.
NOTE: If you encounter an exception UnityEngine.AddressableAssets.InvalidKeyException in example scenes, there is a problem, that Unity can’t find imported Addressables. In this case try to build newly imported addressable groups from window Addressables Groups > Build > New Build
NOTE: Before you continue, you should read the documentation about Scriptable Items & Groups
CountryGroup is a derived class from class ScriptableItem with a Reorderable List of classes Country.
Each Country has a Name, ISO Code, ISO Code (3), Capital City & Dialing Code.
You are free to create custom Country Groups:
Project Window (Right Click) > Create > Dragon Arts > Collection > Country Group
There is also a button SYNCHRONIZE, which overwrites attributes based on ISO Code or ISO Code (3), so in case of custom Country Groups there is not needed to manually fill each field. Data are loaded from the Master Country Group:
NOTE: Do not update Master Country Group manually.
There are 2 options to get Country Flags into your project. First is by using configured TextMeshPro Sprite Asset straight in texts, e.g.:
<sprite name="SVK">
The second option is load them through address through Country class methods:
using DragonArts.Collection.Countries; // NOTE: Do not forget to import namespace
// ...
Country country = countries.list[0];
Sprite flag = await country.LoadFlag();
// ...
There is also a static method:
Sprite flag = await Country.LoadFlag("SVK");
Do not forget to release loaded flags after that you don’t need them anymore:
country.ReleaseFlag();
In case of static method, you have to handle releasing by yourself.
As a bonus the Country Collection contains Anthems, which you can load similarly as you can load Flags:
// ...
Country country = countries.list[0];
AudioClip anthem = await country.LoadAnthem();
// ...
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |