Vector2.MoveTowards 移向

static function MoveTowards (current : Vector2, target : Vector2, maxDistanceDelta : float) : Vector2

Description描述

Moves a point current towards target.

当前的地点移向目标。

This is essentially the same as Vector2.Lerp but instead the function will ensure that the speed never exceeds maxDistanceDelta. Negative values of maxDistanceDelta pushes the vector away from target.

这个函数基本上和Vector2.Lerp相同,但是该函数将确保我们的速度绝不会超过maxDistanceDelta。maxDistanceDelta的负值从目标推开向量。

最后修改:2011年1月4日 Tuesday 21:36

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。