Sevdat Posted July 11 Posted July 11 (edited) Good day, the brackets "{}" inside the Log function causes an error. Unigine.Console.Run("console_onscreen 1"); Log.Warning("{objValue}"); Without using the brackets works, but instead of passing a string "console_onscreen 1" could you make a Unigine.(ConsoleOptions) method to initilize print options? For example: public bool initPrintOnce; public void print(object objValue = null){ if (!initPrintOnce) { Unigine.Console.Run("console_onscreen 1"); initPrintOnce = true; } Log.Warning($"{objValue}"); } You could do print functions such as printMessage, printWarning, printError, printFatal. This would be more comfortable to beginners. Edited July 11 by Sevdat
arizmenda Posted July 11 Posted July 11 Hi! Braces work, but since they contain the name of a variable, it is considered an interpolated string, which means you need to put the dollar sign at the beginning. https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/interpolated Thank you for your feedback! 1
Recommended Posts