hi, i am korean developer.
when tested on pc standalone mode, it’s no problem.
I Using gridgraph, save and load pathfinding data(*.zip)
I save precaculate path data to StreamingAssets folder(http://docs.unity3d.com/Documentation/Manual/StreamingAssets.html)
and iphone publish.
code is like below…
string zipPath = Application.dataPath + “/Raw/PathSave.zip”;
byte[] bytes = Pathfinding.Serialize.AstarSerializer.LoadFromFile (zipPath);
if (bytes != null) AstarPath.active.astarData.DeserializeGraphs (bytes);
at iphone
when call Pathfinding.Serialize.AstarSerializer.LoadFromFile . function call is crashed.
please say to me how to solve this error T_T
thanks
The LoadFromFile function is deprecated, you should use other functions for loading from file.
Can you open the xcode log and see exactly what crashes it?
i don’t run by xcode . because i stuck this problem(http://answers.unity3d.com/questions/22275/xcode-build-and-archive-error-no-such-file-or-dire.html)
you said loadfromfile is deprecated.
please say other file loading method for ios.
thanks… T_T
You could use for example System.IO.File.ReadAllBytes.
Make sure you are using .Net 2.0 or higher (that function requires .Net 2.0).
thanks i decide using text asset for loading .
this will fine . ^^
Ok, but make sure that you use the .bytes extension, not .txt or similar. Otherwise unity will scramble the zip data (described more here: http://arongranberg.com/astar/docs/save-load-graphs.php)