unity性能分析手册(unity中文API之Vector2)
unity性能分析手册(unity中文API之Vector2)
2024-09-30 03:27:36  作者:迂腐的人类  网址:https://m.xinb2b.cn/know/dpm106603.html
Vector2 二维向量


Description 描述

Representation of 2D vectors and points.

表示 2D 的向量和点。

This structure is used in some places to represent 2D positions and vectors (e.g. texture coordinates in a Mesh or texture offsets in Material). In the majority of other cases a Vector3 is used.

这个结构用于在一些地方表示2D的位置和向量(例如:网格中的纹理坐标,或者材质中的纹理偏移)。在其他情况下大多数使用Vector3。

Static Variables 静态变量

one Shorthand for writing Vector2(1, 1).

Vector2(1, 1)的简写。 right Shorthand for writing Vector2(1, 0).

Vector2(1, 0)的简写。 up Shorthand for writing Vector2(0, 1).

Vector2(0, 1)的简写。 zero Shorthand for writing Vector2(0, 0).

Vector2(0, 0)的简写。

Variables 变量

magnitude Returns the length of this vector (Read Only).

返回向量的长度(只读)。 normalized Returns this vector with a magnitude of 1 (Read Only).

返回向量的长度为1(只读)。 sqrMagnitude Returns the squared length of this vector (Read Only).

返回这个向量的长度的平方(只读)。 this[int] Access the x or y component using [0] or [1] respectively.

使用(索引器)[0]或者[1]分别访问组件x或者y组件。 x X component of the vector.

向量的X组件。 y Y component of the vector.

向量的Y组件。

Constructors 构造器

Vector2 Constructs a new vector with given x, y components.

创建一个新的具有给定x,y组件的向量。

Functions 函数

Normalize Makes this vector have a magnitude of 1.

使向量的长度为1。 Set Set x and y components of an existing Vector2.

设置已知二维变量的x和y。 ToString Returns a nicely formatted string for this vector.

返回该向量一个格式化好的字符串。

Static Functions 静态函数

Angle Returns the angle in degrees between from and to.

在from和to之间返回一个角度。 ClampMagnitude Returns a copy of vector with its magnitude clamped to maxLength.

返回向量的长度,最大不超过maxLength所指示的长度。 Distance Returns the distance between a and b.

返回a和b之间的距离。 Dot Dot Product of two vectors.

两个向量的点乘积。 Lerp Linearly interpolates between two vectors.

两个向量之间的线性插值。 Max Returns a vector that is made from the largest components of two vectors.

返回一个由两个向量的最大组件组成的向量。 Min Returns a vector that is made from the smallest components of two vectors.

返回一个由两个向量的最小组件组成的向量。 MoveTowards Moves a point current towards target.

当前的地点移向目标。 Reflect Reflects a vector off the vector defined by a normal.

定义在正常情况下映射向量离开向量。 Scale Multiplies two vectors component-wise.

两个矢量组件对应相乘。 SmoothDamp Gradually changes a vector towards a desired goal over time.

随着时间的推移逐渐改变一个向量朝着期望的目标。

operators 运算符

operator - Subtracts one vector from another.

一个向量减去另一个向量。 operator != Returns true if vectors different.

如果向量不同返回真。 operator * Multiplies a vector by a number.

一个向量乘以一个数字。 operator / Divides a vector by a number.

一个向量除以一个数字。 operator Adds two vectors.

两个向量相加。 operator == Returns true if the vectors are equal.

如果向量相等返回真。 operator Vector2 Converts a Vector3 to a Vector2.

将一个Vector3转化成一个Vector2。 operator Vector3 Converts a Vector2 to a Vector3.

将一个Vector2转化成一个Vector3。

  • 苏州小学入学条件(苏州城区义务教育入学信息采集)
  • 2024-09-30苏州城区义务教育入学信息采集昨天,苏州市教育局发布了《苏州城区义务教育入学信息采集相关指南》,信息采集需要准备哪些材料?如何操作?一起来看看!依据《义务教育法》《未成年人保护法》等法律法规,各市、区教育行政部门和中小学要依法保障。
  • 40岁女人小脸型适合什么发型(有哪些发型)
  • 2024-09-30有哪些发型很显气质、又不失女人味的一款侧分锁骨短烫发,很适合30-40岁以上的女人,两颊的头发经过微烫处理,带着一丝弧度感,很好对圆脸蛋进行修饰,发尾外翘的设计,莫名又增加了一丝俏皮、可爱感韩式短发烫发,头发修。
  • 学诗歌的孩子(孩子天生与诗歌有缘)
  • 2024-09-30孩子天生与诗歌有缘来源:【阳光报•阳光网】文■王宜振在学校开展诗歌教育中,不少学校开设了诗歌课程在诗歌课堂上,老师们引导孩子们读诗、诵诗、欣赏诗,我觉得还应该让孩子学着写一点诗也许有人会说:诗歌是文学中的文学,诗歌是皇。
  • 真羊肉才会又膻又腥吗(聊一聊羊肉为什么会有膻味)
  • 2024-09-30聊一聊羊肉为什么会有膻味很多消费者在吃羊肉时“闻膻色变”,也有不少女性消费者就是因为受不了这膻味,一杆子打死压根就不再吃羊肉了不知道多少人还会记得小时候,看到灶台前一碗白白的雪花膏,以为真像雪花膏那么香,结果闻了下,嗯~吐得。
  • 关于牛奶的基本知识和方法(你需要了解的都在这里)
  • 2024-09-30你需要了解的都在这里一个提问:牛奶加热超过62℃,营养成分真的就会消失吗?经检测结果显示,牛奶在常温、60℃、80℃和100℃的不同温度下,其中的主要营养成分:蛋白质、钙和维生素D,含量几乎没有变化煮沸加热,对牛奶中的主。
  • 蜥蜴蜕皮需要注意什么(在干细胞的帮助下)
  • 2024-09-30在干细胞的帮助下本文为转化医学网原创,转载请注明出处作者:Ashley导读:众所周知,蜥蜴会再生截断的尾巴,但再生尾巴是取代包括脊柱和神经的原始尾巴的一个不完美的软骨管而近期研究发现,经过基因编辑的胚胎神经干细胞可以。
  • 猪饲料中毒有什么症状(猪中毒系列四)
  • 2024-09-30猪中毒系列四  酒糟中毒,其实是因为酒糟中所含酒精,酒精酸败后形成醋酸,多量长时间饲喂酒糟,或突然改喂大量酒糟,均易造成中毒一、病因  酒糟若存放过久,发酵酸败后产生多种有毒游离酸和杂醇油,用来猪长期喂猪或一次性。
  • 唐懿宗庙号为何为懿
  • 2024-09-30唐懿宗庙号为何为懿李漼,即唐懿宗,大和七年农历十一月十四日生于籓邸,唐朝第十七位皇帝,除去武则天和殇帝李重茂,唐宣宗李忱长子,母元昭皇太后晁氏唐宣宗驾崩,李漼被宦官迎立为帝他是唐朝倒数第四个皇帝,是唐朝最后一个以长子即。
  • 大学可以考哪些含金量高的证书(这五本证书的含金量几乎为零)
  • 2024-09-30这五本证书的含金量几乎为零很多人觉得,考的证书越多越好,有证傍身,比较好找工作,所以越来越多人忙忙碌碌成为“考证一族”其实,证书不一定就是越多越好,考有含金量的证书才有意义,不是证书越多越好,有些证书,考了也是白考今天吴老师就。