What is the reference for scripting? .net? mono? Let's clear things here

I am new here and I am trying to understand how to script code in javascript in Unity but honeslty I still didn’t get which is the basic reference for scripting code here…

Where should I look at? msdn reference? mono reference?

Please help me with this! -.-

For things Unity specific, I use:

For things not Unity specific, I mostly use MSDN with some StackOverflow - you just need to remember that Unity uses .Net ~3.5, not 4.

Okay let just say I would like to manipulate strings in javascript…Where should I look in msdn?

JavaScript is a bit weird since it’s a Unity specific implementation, but most of the .Net features should work fine. Just look at the MSDN for “string” and most of the functions there should work with UnityScript(JS) - you’ll likely have to convert any code examples yourself though since MSDN doesn’t have JS examples for a lot of things. And as far as I know, generic functions will not work in UnityScript.

What your really want to look at are all the functions listed under “Methods”

MonoDevelop is basically a virtual machine that allows .NET to run on multiple platforms. Think of it as Mono is to .NET what JVM is to Java. More or less, you have the .NET 3.5 libraries available to you (as KyleStaves pointed out above). A precise overview of available libraries can be found here.

The downfall of using JavaScript instead of C# (and really why I made the switch myself eventually) is you need to include the full path to the library you’re using, so things can get verbose and difficult to read in a hurry.

Great!!! Thank you so much for providing me this information!

I didn’t understant the problem about js instead of C# honestly…what do you mean KelsoMRK?

Say for example I want to use a Dictionary to store some Key/Value pairs. In C# I could write something like this:

using System.Collections.Generic;

public Dictionary<string, string> dictionary = new Dictionary<string, string>();

The JavaScript equivalent would be (I think!):

public System.Collections.Generic.Dictionary<string, string> dictionary = new System.Collections.Generic.Dictionary<string, string>();

Naw, that’s crazy talk :slight_smile:

import System.Collections.Generic;

var myDictionary = Dictionary.<String, String>();

works just fine.

thank you legend411 for clearifing this! I was already thinking that I had to switch to C# :smile: