Testing unity functions with console commands
How would I test a function without pressing the play button and waiting for a build everytime?
For example if I just wanted to see what the output of Mathf.Clamp(amount, min, max);
would be without logging it somewhere in my build, is this possible? Probably from somewhere within Visual Studio?
Answer by xxmariofer · Dec 04, 2020 at 09:25 AM
No you cant, c# needs to get compiled, but take a look at unit tests, its not exactly what you are looking for but helps you test functionalities of your games (but it is obviosly to much work if you only want to execute a method)
https://www.tutorialspoint.com/unittest_framework/unittest_framework_overview.htm
Answer by nathanccaldwell · Dec 04, 2020 at 06:49 PM
Yeah that's unfortunate, I like to play around with functions myself on top of reading documentation. Helps me a lot with proof of concept.
Your answer
![](https://koobas.hobune.stream/wayback/20220613021033im_/https://answers.unity.com/themes/thub/images/avi.jpg)