Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

wading through Javascript and C# scripts

Discussion in 'Scripting' started by squidsquadron, Sep 3, 2008.

  1. squidsquadron

    squidsquadron

    Joined:
    Sep 3, 2008
    Posts:
    1
    I've been trying to script but there's too much noise. For instance, if I try to make a Javascript and lookup some examples I'll find some C# script. The same for making C# scripts. Neither mesh well together and just adds confusion and frustration. Here are some requests from a newbie scripter.

    1. Can some one organize the Javascripts and C# scripts into separate collection. There are some great examples posted, but it's a jungle.

    2. The script editor doesn't link to any library.
    Example: var rot = Quaternion.FromToRotation(....)
    You wouldn't know to call FromToRotation(...) from Quaternion without digging around in the forums or references. This might sound whinny to veteran scripters in Unity, but it's darn frustrating.

    If these topics have been brought up before, please send me the link to that thread.

    Thanks
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Not sure which scripts you're talking about...the docs are mostly Javascript, the wiki is already organized by category, and if you mean the forums...I don't think that's going to happen. :) The structure and syntax of JS and C# are similar and in some cases identical; I can see that it would be confusing for a newcomer, but once you understand the differences it's pretty trivial to translate from one to the other.

    If you're talking about Unitron, just click on the keyword you want and then click Search Docs, or type Command-'.

    --Eric
     
  3. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Um, you could also check the docs and pages like this. But that seems separate from your original topic and we agree that we need to be better about offering more script examples in the docs (in all scripting languages we support). We're always working on it and have this on our radar already.
     
  4. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    I would suggest to use a decent editor, like bbedit or get parallels and use visual studio C# free edition :) you save a lot of time and what you have to do is simply copy and paste the code into a textfile and save it as cs file and load it in Unity

    If you write in JS, Eclipse is maybe the best IDE for coding (IMHO); i don;t like Java and all the foster kids, so i go with c#
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    If you don't like Java, how come you're using C#, which is extremely similar to Java? It's far more like Java than Javascript is, which as everybody knows has nothing whatsoever to do with Java....

    --Eric
     
  6. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    Long story short....i do not like people that use java because is like to get on a language that is like C++ without pointers and multiple inheritance :)

    I work with people that code in java for web apps, and i do not like web apps...and when you tell them that C++ is a serious language, they simply shake their head and say that life should be easy, and java make it easier :)

    I am for "programming for few"; is a very well paid job, and a good programmer is closed by pseudo programmers that get languages like java and similar, taking away the market....20 years ago you can count on a solid base of cobol and C++ programmers, and they were pretty much the ones that spent a life to learn how to program and sell their work ability; while now a guy takes few courses and call himself a programmer, only because can make a page in ajax :p

    And who makes drivers in C++ get maybe the same money, or even less >_<

    Anyway, i am going OT....as you pointed out they are similar, and if you came from C++ you wanna use something that is closer to what you know, and that could be useful to do other stuff (c#+XNA=windows development); while "unity javascript" is not really useful outside Unity :)