找回密码
 立即注册
查看: 5791|回复: 73

[基础] Flash To Unity3D常用技巧整理

[复制链接]
发表于 2012-12-17 12:40 | 显示全部楼层 |阅读模式
资源信息 Tutorial Information
教程名称: Flash To Unity3D常用技巧整理(发帖教程)
适用引擎:   (适用引擎,为空默认为Unity)
教程语种: English
教程等级: 1
教程格式: 图文(请用IE9以上浏览器访问本版块)
教程作者: Ryan Henson Creighton (如有问题请短消息联系作者或发表回复)
下载地址: (兑换积分)
点击查看原图
美丽分割线
非常实用的技巧整理,特别是对学习过flash的朋友!
i’ve been using Unity3D on and off for a week now. i’d burned through about a dozen beginner tutorials, and am a little overwhelmed by how much i don’t know about the engine, which enables you to create 3D games to deploy to a number of platforms, including the iPhone and web browsers.

i’d look like a fool if i tried to write a tutorial at this point. So instead, i’ll share this list of translations of common Actionscript 3 coding tasks to the Unity3D engine’s JavaScript-like UnityScript language.


1. Render an Object Visible or Invisible

Actionscript 3:

thing.visible = true; // or false

UnityScript:

thing.renderer.enabled = true; // or false

2. Tint an Object

Actionscript 3:

var colorTransform:ColorTransform = new ColorTransform();

colorTransform.color = 0xFF0000;

thing.transform.colorTransform=colorTransform;

UnityScript:

thing.renderer.material.color = Color.red;

3. Get a Random Number

Actionscript 3:

var someRandomNumberBetween0And5:int = Math.floor(Math.random()*5);

UnityScript:

var someRandomNumberBetween0And5:int = Random.Range(0, 5);

4. Respond to a Key Press

Actionscript 3:

stage.addEventListener(KeyboardEvent.KEY_DOWN, doKeyDown);

private function doKeyDown(e:KeyboardEvent):void

{

switch(e.keyCode)

{

case 32:

// Space bar! Do stuff.

break;

default:

break;

}

}

UnityScript:

if(Input.GetKeyDown("space"))

{

// Do stuff.

}

5. Open a Web Page

Actionscript 3:

navigateToURL(new URL("http://www.untoldentertainment.com"), "_self");

UnityScript:

Application.OpenURL("http://www.untoldentertainment.com");

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
发表于 2013-5-3 11:53 | 显示全部楼层

感谢楼主的无私分享!{:soso__11402694654016840197_7:}
发表于 2017-2-18 11:31 | 显示全部楼层
楼主是超人
发表于 2017-2-18 11:52 | 显示全部楼层
好帖就是要顶
发表于 2017-2-18 11:50 | 显示全部楼层
顶顶多好
发表于 2017-2-18 11:17 | 显示全部楼层
很好哦
发表于 2017-2-18 11:49 | 显示全部楼层
LZ真是人才
发表于 2017-3-25 17:27 | 显示全部楼层
楼主是超人
发表于 2017-3-25 17:38 | 显示全部楼层
顶顶多好
发表于 2017-3-25 18:05 | 显示全部楼层
难得一见的好帖
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-11-23 16:22 , Processed in 0.286432 second(s), 31 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表