网站大量收购独家精品文档,联系QQ:2885784924

Unity3d的Javascript入门教程.pdf

  1. 1、本文档共18页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Unity3d的Javascript入门教程

12-7-10 Unity3d的Javascript入门教程_Developer_百度空间 Developer Developer 我在奔跑 , 我在狂笑 ,我还很年轻~ Unity3d的Javascript入门教程 2011-10-20 19 04 VARIABLES (变量) Lets think of a variable as acontainer that holds something. The Value you set the variable tobe is what it beco mes. 我们来想想,变量就像一个临时存贮某种东西的容器,你给它设置什么值,它就会变成什么 You can choose to name a variable anything you wish, as long as itcontains no spaces, starts with a letter(prefera bly lower case),contains only letters, numbers, or underscores, and is not areserved keyword. 你可以给你的变量命你想要的名字.以小写字母开头.包括使用字母,数字,下划线. Use the keyword var to create a variable. Lets call our firstone box. 输入var可以创建一个变量,让我们调用我们的第一个叫box的变量. Code (代码) var box; There you go; youve declared your first variable! If yourewondering about the semicolon at the end, statements (commands) inJavascript must end in a semicolon. Javascript中在申明一个变量时要以;结尾. iPhone programmers, if you declare a variable without setting it toa value, you must state what type the variable is, in this caseString. Common types include String, int, float, boolean, andArray. 如果是IPhone程序员,在声明一个变量时一定要指明变量的类型.在这个案例中是字符串型,一般情况下变量类型包括字符串型 ,整型,布尔型和阵列. Note that proper capitalization isnecessary! var box String; Of course, our box is empty, so lets set it to a value by addingthe following line 当然我们的box是空的,因此我增加以代码给它一个值. Code box =apple; Now our box contains a text string (variable type), which happensto be apple. 现在我们的box包含字符型.它叫apple. Note that you can declare your variable and set it to a value inthe same statement 也可以这样写 /184367426/item/c94

文档评论(0)

a888118a + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档