jsでUnity
数年ぶりにjsでUnity触った。。
また書き方忘れそうなのでメモ。
コンポーネントを取得するとき
C#
gameObject.GetComponent<Renderer>().enabled = true;
JavaScript
gameObject.GetComponent.<Renderer>().enabled = true;
JSの場合はGetComponentの後ろに.が入るのねー。
seen from Israel

seen from Dominican Republic
seen from China
seen from Israel

seen from Singapore
seen from Germany

seen from United States
seen from United States
seen from United Kingdom
seen from Senegal
seen from United States
seen from Denmark
seen from Indonesia

seen from Australia
seen from China
seen from United States
seen from China
seen from China
seen from United States

seen from Dominican Republic
jsでUnity
数年ぶりにjsでUnity触った。。
また書き方忘れそうなのでメモ。
コンポーネントを取得するとき
C#
gameObject.GetComponent<Renderer>().enabled = true;
JavaScript
gameObject.GetComponent.<Renderer>().enabled = true;
JSの場合はGetComponentの後ろに.が入るのねー。
https://play.google.com/store/apps/details?id=com.ibnesina.Swingly
unityscript sucks eggs
Super simple, fast and easy to use tweening functions for unity which incorporates optimised Robert Penner's equations.Easing Functions for Unity Functions taken from github
Unityscript or C#
I ran into a couple of issues while learning Unityscript that made me question if I should be learning it, instead of C#. I've come to the decision that I'll be going with C# due to its usability outside of Unity (as opposed to Unityscript being a unity only language) and all of the documentation found online for C#. This is a personal decision that I think a lot of people that are just getting into Unity and scripting will run into so I wanted to make a compilation of some discussion that I've found useful in helping me make a decision on the subject.
http://embracing-unity.blogspot.com/2013/05/unityscript-vs-c.html
http://forum.unity3d.com/threads/boo-c-and-javascript-in-unity-experiences-and-opinions.18507/
http://forum.unity3d.com/threads/scripting-section-faq.19302/
http://forum.unity3d.com/threads/do-you-script-in-unityscript-or-c-and-why-poll.201260/
http://www.reddit.com/r/Unity3D/comments/193m4p/starting_out_in_unity_c_or_javascript/
As you can see, it mainly comes down to personal preference and mechanically you can get the same-ish performance out of both of them via techniques. So if mechanics aren't an issue, what is? Like I mentioned earlier, online documentation is a huge factor on how fast you'll be able to learn the language. I say that because if you're anything like me, learning a language is a metric-shit-ton easier if you have a lot of material to cross-reference. Secondly, what if you find you want to do some programming outside of unity? Well if you spent all your time investing in Unityscript you'll only be able to take away the basics of coding/scripting from it and still be left with learning another set of syntax and rules.
Personally, I'll be switching to C# because it seems more practical. But it's worth giving the issue some serious thought with your own personal situation and goals as considerations. So take a read through the links I've provided and do some searching on your own.
Learning to unityscript: Part 2
I've found that over the course of learning the unityscript language it has been impossible for me to use only one guide and comprehend everything I'm reading. No matter how good I feel a guide is, none will ever be perfectly formatted and explained for my specific learning capabilities. So what have I done to help alleviate this problem? Cross reference, cross reference, cross reference. And that's what I'm here to post today. A list of a few scripting tutorials I've been going back and forth through when ever I'm starting to draw blanks on any particular subject.
This .pdf is what I suggest you focus on... bim.wikispaces.com/file/view/UnityScript_Basics_for_Noobs.pdf
Then use these sites to help you along the way... http://forum.unity3d.com/threads/34015-Newbie-guide-to-Unity-Javascript http://wiki.unity3d.com/index.php/Head_First_into_Unity_with_UnityScript https://docs.unity3d.com/Documentation/ScriptReference/ http://unity3d.com/learn/tutorials/modules/beginner/scripting
Let me tell you what. Every single time you get stumped while reading the .pdf just go between all of these sites (skip to the problem area's section) and after reading each of them go back to the .pdf. Do this till you understand the problem area. If you're anything like me, it may help everything click while also giving you a better understanding of the language as a whole.
Also, playing with code yourself can be a huge help. Even if it is just punching it into Notepad++. If all else fails, write it out yourself and that may be your magic "ohhh" button.
Learning to unityscript: Part 1
I found one of the greatest unityscript (a form of javascript used in Unity) guides any scripting noob could ask for. The author explains everything like you're just having a conversation with a friend. It's well written, humorous, and most importantly, very informative as it pertains to the core concepts of scripting and coding in general. http://bim.wikispaces.com/file/view/UnityScript_Basics_for_Noobs.pdf/315882006/UnityScript_Basics_for_Noobs.pdf And it will teach you the basics of all coding syntax, so you could get your foot in the door with any language (even non-scripting languages such as C++, Java, ect) if you understand the core concepts here. Check it out, it's free.
I named him Hal. It's ok, he's friendly...
Do you like the idea of giving digital objects brains? Want a crash course on how to script? This site has a free online course that teaches how to use javascript in Unity to do anything your mind can come up with. There are other courses on the site as well. Some free, some not. But it's worth taking a look at if the mad scientist inside of you feels the need to be released. http://walkerboystudio.com/html/unity_training___free__.html#unity3javaScript