Programming rather then scripting

Hey,

this is my first post here and i’m pretty new to Unity.

I have a strong programming background and i’d like to know if there are ways to prgram rather then scripting. From what i saw so far it’s like mostly the case, that JavaScript like scripting is the first choice of using Unity.

But seeing a C# support, i’d like to know how low level is the access to Unity’s API is.

Is there a way to program in a object orientated fashion?

Best regards!

Since Unity uses Mono, which is an open source .NET implementation, which is entirely a virtual machine language based upon objects – Yes, you can program in an object orientated fashion. :slight_smile:

As for low-level, whatever has been exposed in Mono can be accessed, which is practically everything.

I don’t see a difference between scripting and programming these days. As long as I am using a Turing complete language, I consider it programming. The original meaning of the word “script” seems to have come from a simplistic building-block style assembly that could be used to control a larger, more complex program. (Think, DOS batch files or shell scripts.)

But these days, a “script” usually just means that it is a programming language embedded within another for ease of in-situ modification.

Heck, one of my game engines embedded straight up ANSI C as a “scripting” language. The neat thing about this was that the scripting engine could compile the engine’s own source code, which was also written in C. Which was weird but fun, and I abused it greatly. :slight_smile:

With that said, if you use straight up C#, you’re pretty much coding as close to bare metal in Unity as you can without writing external DLLs that call internal engine methods. (Which is always an option if the raw speed of Mono can’t handle what you want to do.)

Javascript is comparable, but only if you’ve disabled dynamic typing by using the #pragma script keyword. (Even so, Unity will try to guess what can be statically defined.)

Define ‘object oriented’.

No, really. I’m a professional developer. With Unity and it’s component system, I can do very nice OO designs, even just using JavaScript. Exposed variables on scripts make for a very nice beginning of a dependency injection framework.

(Though, admittedly, I’ve considered doing more in C# to get a hold of events, etc.)

The difference between “programming” and “scripting” is, IMHO, more about the difference in structure than it is about the difference in language. You can “program” in perl, python, and ruby, and you can “script” in C++ or C.

It’s also worth noting that Javascript has a lot of its roots in Scheme, a variant of Lisp. I’d call that a programming language.