August 2018
Beginner
334 pages
10h 19m
English
We'll learn ways to implement the LoadMap function by using the .map file format as an example:
private void LoadMap(string filename)
{
string path = Application.dataPath + "/" + mapsDir + "/" + filename;
try
{
StreamReader strmRdr = new StreamReader(path);
using (strmRdr)
{
// next steps in here
}
}
catch (Exception e)
{
Debug.LogException(e);
}
}
int j = 0; int i = 0; int id = 0; string line; Vector3 position = Vector3.zero; Vector3 scale = Vector3.zero;
line = strmRdr.ReadLine();// non-important line line = strmRdr.ReadLine();// height ...
Read now
Unlock full access