Grapher is an editor extension to help with debugging and analysis of variables.
It can visualise multiple variables in a form of a graph, log them to a file and replay them in the exact manner.
This is the result of running a few Grapher.Log()s in the play mode (notice the LIVE text in the top left). Bring up Grapher by pressing “Ctrl + G” (or Mac OSX equivalent) or dock the window and this is the result:
Each variable is being logged into an individual .csv file (if logging is enabled for that variable, little save icon next to the name). It is possible to load any number of different .csv files and have them play at the same time. More files can be added even while replay is on. To speed things up all the files from the same session (from pressing play to stopping) are also added to a .ses file. Opening those loads all the variables from that session simultaneously, although you could open them one by one if you wanted to do so.
Example logging output:
S699 represents session number, and the number at the end is a timestamp. Grapher can be configured in settings to overwrite files in which case the name will not be unique, e.g. Cos1.csv.
Grapher will be available on the Unity Asset Store in about 10 days.
I have just submitted the package after some more improvements and fixes, so it should be out soon. Asset Store review times seem to be random at best.
how can I use your graph within a component since within a component script, Grapher is not accessible ? I am struggling to find the best way to use grapher in that context.
Hello,
sorry for not responding earlier, I was on mobile for the whole week and Unity forums seem to randomly not send notifications to my mail.
Check the first post in here for usage. If the Grapher has been properly imported you can use it just like you would use Unity’s Debug class since it is a static class.
uhm I see, it’s because of the misleading documentation that says to move Grapher inside an Editor folder. If you move a script inside an Editor folder, then it’s inaccessible from a regular component.
Would it not make more sense to use scripting symbols so that you can have Grapher in your assets and would not cause any trouble when compiling using #IF UNITY_EDITOR ?
Grapher is great. It works well, in the Editor, with only one line of code.
Well done.
However, I now have an issue when I try to build my game:
Assets/Grapher/Grapher.cs(12,32): error CS0246: The type or namespace name ‘EditorWindow’ could not be found (are you missing a using directive or an assembly reference?)
How do I tell Unity3D to build my game without Grapher?
Could I ask what version of Unity you are using so I can replicate this?
If the editor folder does not work one way to fix this would be to put whole problematic class under “#if UNITY_EDITOR” directive.