A* Pathfinding Project
3.1.4
The A* Pathfinding Project for Unity 3D
|
In the pro version of the A* Pathfinding Project there is a tab called "Optimization" in the A* Inspector.
This tab searches the project for places where preprocessor directives are listed. A preprocessor directive is a piece of code which controls if another piece of code should be included in the compilation or not.
As you can see, it works like ordinary IF statements. What's good with them is that they have absolutely no runtime overhead, they are all evaluated at compile time.
The A* Pathfinding Project has some aspects of it which can be customized. It would normally require hand editing of code, but preprocessor directives solves that.
Perhaps the most useful .#define is the SingleCoreOptimize directive. If you click on the "Optimizations" tab to open it, you will see a list with all available directives. The SingleCoreOptimize directive should be listed there. Per default, the SingleCoreOptimize directive is not enabled, what is does when enabled is to restrict the number of threads pathfinding can run in to one (1), and when it is restricted to one, it can apply some memory and performance optimizations based on that. Especially memory usage can be reduced quite a lot. This directive is recommended to have enabled when deploying for mobile devices which are usually only single or dual core and are often low on available memory.
Other directives apply various other optimizations (see their respective descriptions) or enable debugging messages (though they are probably not very useful for other people than developers).
If the directives are enabled or not is stored in the source code as commented or not commented lines of #define statements which means that the settings are shared between all your scenes in your Unity project.