Thursday 24 November 2011

INISystem - Intro Tutorial


Here's a very simple introduction tutorial for INISystem (Available on Unity's Asset Store Now).

You will need to purchase and download INISystem from http://u3d.as/content/corrupted-smile-studio/inisystem. Once downloaded you will have a new folder called INISystem within your project. this contains all the required files (one in total), an example scene, an example HUD script and a Readme PDF.

The INISystem main class is contained with the CSS namespace. This means that you will need to add using CSS; to the top of the file creating the INISystem class.

You will then need to create an instance of the INISystem class.
INISystem ini = new INISystem();
To load a file it is as easy as calling ini.LoadFile(PathToFile); which returns a boolean based on whether the file was loaded or not. Then you can read strings from the file via ini.GetString("elementName", "SectionName", "Optional Default Value");


To change a value and then save the file you can make use of ini.Change("elementName", "NewValue", "SectionName"); which will either change a current value or add it if it doesn't exist. To save to file use ini.Save(pathToFile);


I hope this short intro tutorial will help you understand how easy this system is to use.

Regards,
Garth (Lead)

No comments:

Post a Comment