Ho to access a group of text

More
7 years 3 weeks ago #2180 by KimAndersenGF
Hi there;

Great Asset!

I am working on a game with a group of text that i need to access.
I have made the entry in the database with a "MyGroup/myEntry1" and i know how to retrieve a single entry.
But i need to run through all the items in the group. I am using c#.

It should go like this:
int theCountOfTheList = I2.Loc.ScriptLocalizaton.Get("MyGroup").Length; //But nothing returns.

And then i have to run through the group with a simple loop...

Can you help?

Regards Kim Andersen

Please Log in or Create an account to join the conversation.

More
7 years 3 weeks ago #2181 by Frank
Replied by Frank on topic Ho to access a group of text
Hi,
You can use the function LocalizationManager.GetTermsList to get all terms belonging to a category:
List<string> terms = I2.Loc.LocalizationManager.GetTermsList("MyGroup");

int theCountOfTheList = terms.Count;
foreach (var term in terms)
      Debug.Log( term );

Hope that helps,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

Time to create page: 0.154 seconds
Template by JoomlaShine