E
E
evgeniy20032022-03-12 08:58:31
C++ / C#
evgeniy2003, 2022-03-12 08:58:31

Why is c# different in unity?

Hello everyone, don’t throw too many rotten tomatoes, I’m just a beginner :) The bottom line is this, I’ve wanted to use unity for a long time and finally got around to it, and immediately ran into such a mismatch. In the book I'm reading, a command is written to print a message to the console - print("fire"); Before that, I once got acquainted with c# and even know that Console.Write("something interesting"); is used to output messages to the console. I set up an experiment, connected using System and wrote Console.Write instead of print. No compilation errors came out, but the text is not displayed in the console either. Why is that? Why make different methods that do the same thing?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
HemulGM, 2022-03-12
@evgeniy2003

Because there is no console in Unity (in the form in which you are trying to do this). Your C# scripts in Unity become part of a template program that doesn't have a console.

M
MrMastire, 2022-03-12
@MrMastire

Look, C# has all sorts of desktop applications, you can do them in Visual Studio, there is a console, ASP.NET (websites), WinForms, WPF. And in unity there is simply no such console, even if you register this in WinForms, nothing will happen, because there is simply no place to display it. And unity is not a separate language, it has its own API (this is for the actions of one program with another), that is, in addition to the usual functions and C # commands, it has its own, like Vector3, etc.
(I tried to explain in very simple words, thanks for helping)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question