function Translate (translation : Vector3relativeTo : Space = Space.Self) : void

Description描述

Moves the transform in the direction and distance of translation.

移动transform在translation的方向和距离。

简单的说,向某方向移动物体多少距离。

If relativeTo is left out or set to Space.Self the movement is applied relative to the transform's local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the movement is applied relative to the world coordinate system.

如果relativeTo留空或者设置为Space.Self,移动被应用相对于变换的自身轴。(当在场景视图选择物体时,x、y和z轴显示)如果相对于Space.World 移动被应用相对于世界坐标系统。

function Update() {
// Move the object forward along its z axis 1 unit/second.
//沿着z轴1单位/秒,向前移动物体
transform.Translate(Vector3.forward * Time.deltaTime); // Move the object upward in world space 1 unit/second.
//在世界坐标沿着y轴1单位/秒,向上移动物体
transform.Translate(Vector3.up * Time.deltaTime, Space.World);
}

• function Translate (x : float, y : float, z : float, relativeTo : Space = Space.Self) : void

Description描述

Moves the transform by x along the x axis, y along the y axis, and z along the z axis.

移动变换由x沿着x轴,y沿着y轴,z沿着z轴。

If relativeTo is left out or set to Space.Self the movement is applied relative to the transform's local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the movement is applied relative to the world coordinate system.

如果relativeTo留空或者设置为Space.Self,移动被应用相对于变换的自身轴。(当在场景视图选择物体时,x、y和z轴显示)如果相对于Space.World 移动被应用相对于世界坐标系统。

function Update() {
// Move the object forward along its z axis 1 unit/second.
//沿着z轴每秒1单位向前移动物体
transform.Translate(0, 0, Time.deltaTime); // Move the object upward in world space 1 unit/second.
//在世界坐标每秒1单位向上移动物体
transform.Translate(0, Time.deltaTime, 0, Space.World);
}

• function Translate (translation : Vector3relativeTo : Transform) : void

Description描述

Moves the transform in the direction and distance of translation.

移动transform在translation的方向和距离。

简单的说,向某方向移动物体多少距离。

The movement is applied relative to /relativeTo/'s local coordinate system. If relativeTo is null, the movement is applied relative to the world coordinate system.

移动被应用相对于(relativeTo : Transform)的自身坐标系统。日光相对于为null,则移动被应用相对于世界坐标系统。

function Update() {
// Move the object to the right relative to the camera 1 unit/second.
//相对于摄像机每秒1单位向右移动物体
transform.Translate(Vector3.right * Time.deltaTime, Camera.main.transform);
}

• function Translate (x : float, y : float, z : float, relativeTo : Transform) : void

Description描述

Moves the transform by x along the x axis, y along the y axis, and z along the z axis.

移动变换由x沿着x轴,y沿着y轴,z沿着z轴。

The movement is applied relative to /relativeTo/'s local coordinate system. If relativeTo is null, the movement is applied relative to the world coordinate system.

移动被应用相对于(relativeTo : Transform)的自身坐标系统。日光相对于为null,则移动被应用相对于世界坐标系统。

function Update() {
// Move the object to the right relative to the camera 1 unit/second.
//相对于摄像机每秒1单位向右移动物体
transform.Translate(Time.deltaTime, 0, 0, Camera.main.transform);
}

Transform.Translate 平移的更多相关文章

  1. CSS3中很容易混淆的transform,translate,transition。如何去区分,以及综合写法。

    属性 含义     transition(过渡) 用于设置元素的样式过度,和animation有着类似的效果,但细节上有很大的不同 transform(变形) 用于元素进行旋转.缩放.移动或倾斜,和设 ...

  2. CSS3:transform translate transition 这些都是什么?

    transform:一个属性名称,即CSS3 2D转换 属性. translate:一个属性函数,用法是translate(dx,dy) div { transform: translate(50px ...

  3. 父节点使用css的transform: translate(0, 0)时position:fixed在chrome浏览器中无效

    今天在做移动端的页面,无意间发现了一个Chrome浏览器下的一个bug,在使用CSS3的transform: translate(0, 0)属性对节点A进行位置转化,此时A节点下面有一个字节点B,节点 ...

  4. jquery 设置 transform/translate 获取 transform/translate 的值

    //获取 transform 值 var reg=/matrix.(((-)?([0-9]+.)?\d+([, ]+)?){6})./g; var str= progressUI.css(" ...

  5. transform:translate(-50%,-50%)实现水平垂直居中

    .content {    padding:10px;    background:green;    color:#fff;    position:absolute;    top:50%;    ...

  6. transform: translate(-50%, -50%) 实现块元素百分比下居中

    <!doctype html> <html> <head> <meta charset="utf-8"> <title> ...

  7. Unity使用transform.Translate()移动子物体时遇到的小问题

    Unity使用transform.Translate()移动子物体时遇到的小问题 情况大概是这样:父物体A下有子物体B,希望使B在本地坐标系下移动1单位. B物体挂脚本代码如下: transform. ...

  8. transform translate transition 的区别

    transform是变形,下面有translate transform: rotate旋转/scale缩放/skew扭曲/translate移动/matrix矩阵变形transform连写:rotat ...

  9. CSS - Transform(Translate) abnormal shadow in firefox

    问题:当在Firefox中实现动画translate时,会出现虚影的状况: 经查找相关的解决方法,父容器添加样式:outline: 1px solid transparent;//即可解决问题. 但不 ...

随机推荐

  1. 转: listview异步图片加载之优化篇(android)

    Listview异步加载之优化篇 关于listview的异步加载,网上其实很多示例了,总体思想差不多,不过很多版本或是有bug,或是有性能问题有待优化.有鉴于此,本人在网上找了个相对理想的版本并在此基 ...

  2. js获取url参数,操作url参数

    function getParam(key) { var tmp = location.search; tmp = decodeURIComponent(tmp); var index = tmp.i ...

  3. python常用20库

    python核心库和统计 简述 1. Requests.最着名的http库由kenneth reitz编写.这是每个python开发人员必备的. 2. Scrapy.如果您参与webscraping, ...

  4. [ CodeVS冲杯之路 ] P3115

    不充钱,你怎么AC? 题目:http://codevs.cn/problem/3115/ 基础的高精度减法,先判断一下被减数是否小于减数,若是则交换位置,打上 “-” 负号 当然也可以用压位做 #in ...

  5. 积木大赛(NOIP2013)(纯贪心+模拟)

    好吧,这道题也是..醉了. 其实题目编程挺水的,但是贪心过程不好想. 原题传送门 这道题对于任何一个点a[i]如果a[i]<a[i-1]的话,那么假设a[i-1]的高度为X,a[i]的高度为y, ...

  6. 非常好的博客!!!linux内存管理概述【转】

    转自:http://blog.csdn.net/bullbat/article/details/7166140 inux内存管理建立在基本的分页机制基础上,在linux内核中RAM的某些部分将会永久的 ...

  7. Vplayer服务配置-手机播放局域网视频

    如何使用 UPnP DLNA Cedric Fung 2012-08-03 如何使用 UPnP DLNA · Cedric Fung · 2012-08-03 UPnP / DLNA 通用即插即用 ( ...

  8. 打印PE目录数据信息

    printf("数据目录信息:\n"); PIMAGE_DATA_DIRECTORY MyDataDir; MyDataDir = PIMAGE_DATA_DIRECTORY((& ...

  9. 武汉天喻的NFS 磁盘问题

    public void AsyncPaper() { while (true) { try { var jsonText = RedisHelper.BlockPopItemFromList(&quo ...

  10. MVC中路由器程序

    MVC中路由器程序编写方式如下例子 把地址:/home/add?id=1 改写成:/home/add/1 把地址:/home/edit?id=1&sid=2 改写成:/home/edit/1_ ...