Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by dingben · Jun 28, 2010 at 02:54 AM · javascript-specificlanguage-comparison

DIFFERENCES between (true)javascript and Unityjavascript - prototyping

I would hope that all the references in the documentation that state 'javascript' are updated to be 'Unityjavascript'. It should really be 'UnityScript'.

This post is a result of the issue over global variables at: [http://answers.unity3d.com/questions/13717/global-variables-static-keyword][1]

........... Note from above post. If only ECMA-ish then not the same, thus problems. geees... I was afraid you would say that... now I have to dig into a new reference set to see if what I attempt to code using my (true)javascript understanding will fly in this version. Before I start digging, can you tell me if classes in Unityjavascript are attained the same way as in (true)javascript by nesting functions/prototyping? ... and are closures also a way of life in Unityjavascript? I am going to start a thread for 'DIFFERENCES between (true)javascript and Unityjavascript'. ...........

THUS FIRST QUESTION: how does UnityScript handle classes... as a prototyping engine or a class engine as C#, C, etc..

The next post would be 'closures'

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by dhendrix · Jun 28, 2010 at 03:08 AM

There are really far too many differences between the two to even acknowledge imho. It really is just better to treat it as another language entirely.

You should really compare it more to C# actually. And when using documentation outside of the Unity websites, you should stick to MSDN since it is based on the mono framework.

EDIT : This question may be of interest if you haven't seen it yet. It discusses differences between C# and Unity's "Javascript".

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dingben · Jun 28, 2010 at 03:23 AM 0
Share

Thank you. I am glad I explored that early, ins$$anonymous$$d of banging my head at the unknown. I don't know C#, but I am able to read much of it. I seems I will now get acquainted with C# more than expected, even though I will be doing my code in javascript?Unityjavascript?Unityscript?

avatar image
3

Answer by Eric5h5 · Jun 28, 2010 at 03:47 AM

Javascript in Unity is very similar to JScript.NET. Here is a comparison of prototype functions from Javascript/JScript, compared to how you use classes in UnityScript/JScript.NET. It looks like all the JScript.NET code on that page will run as-is with no changes in Unity.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Is there a performance difference between Unity's Javascript and C#? 6 Answers

Script translation 2 Answers

Can I declare properties in JS? 1 Answer

How should I decide if I should use C#, JavaScript (UnityScript) or Boo for my project? 14 Answers

Can I use lambda expressions or anonymous methods in JS? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges