ITeye博客

2015 年文章归档

共 1 篇文章

Unity Vector

指向被减向量 // Gets a vector that points from the player's position to the target's. var heading = target.position - player.position; 标准化向量 var distance = heading.magnitude; var direction = heading / distance; // This is now the normalized direction. 比较距离,避免求平方根 if (heading.sqrMagnitude < maxRange * max…

2015-01-04 15:58 · Unity