Search Unity

a few Qs - actionscript 3 user..

Discussion in 'Scripting' started by jonnex, Sep 22, 2008.

  1. jonnex

    jonnex

    Joined:
    Sep 22, 2008
    Posts:
    13
    Hullo,

    I'm getting Unity this week, and I'm wondering which of the supported languages is generally thought to be best to script in, in Unity.

    I've been coding in actionscript for a while, and AS3 is my prefered language. I'm guessing from what I've seen of Javascript and C# that JS is closer (syntax-wise) to AS3, but I get the feeling I'd rather use C#... hehe

    So any opinions, pros cons, thoughts of AS3 users, would be really appreciated!

    Also, does scripting in Unity follow the whole class based system of coding that you use in AS3(I guess I'm meaning OOP, but these terms confuse me!)?

    Thanks for any help!
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    There are already several topics on this, which you can do a search on if you want some lengthy discussion on the issue. Here's a crazy idea though: try them all and see which one you prefer. :) There's a free 30-day trial of Unity so you don't have to wait for anything.

    --Eric
     
  3. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Unity's JavaScript has support for full Object Oriented programming. With support for classes, inheritance and virtual functions.
     
  4. ratamorph

    ratamorph

    Joined:
    Sep 2, 2007
    Posts:
    458
    Does the javascript implementation of Unity support do{}while loops?

    Not being too familiar to javascript prior to using unity I've been just looking up on google to figure out the syntax and what java script supports in general, so far I've had no problem, but I can't seem to find a way to make do{}while() loops in Unity, I always get an error.

    Is there any link to any javascript reference that matches the one in Unity?

    Please forgive my ignorance if this is a very stupid question.
     
  5. podperson

    podperson

    Joined:
    Jun 6, 2006
    Posts:
    1,371
  6. ratamorph

    ratamorph

    Joined:
    Sep 2, 2007
    Posts:
    458
    I know how to do while loops I just don't know how to do:

    do{
    bunch of stuff
    }while(condition)

    This one will execute the code atleast once before testing the condition, has its uses but not a big deal if is not there. I know it's possible to do it in javascript or atleast I found some sites claiming you can.

    The reference is awesome, thanks a lot for posting that, it'll clear a lot of questions I had but was afraid to ask.
     
  7. aaronsullivan

    aaronsullivan

    Joined:
    Nov 10, 2005
    Posts:
    986
    do {
    //bunch o' stuff
    } while (condition);

    did you try with a semicolon? I'd test, but don't have Unity in front of me.
     
  8. podperson

    podperson

    Joined:
    Jun 6, 2006
    Posts:
    1,371
    do {
    } while ();

    won't compile for me. I guess it's not implemented :-/