Version: 2020.2
언어: 한국어

# Vector2

struct in UnityEngine

매뉴얼로 전환

## 설명

Representation of 2D vectors and points.

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.

## 정적 변수

 down Shorthand for writing Vector2(0, -1). left Shorthand for writing Vector2(-1, 0). negativeInfinity Shorthand for writing Vector2(float.NegativeInfinity, float.NegativeInfinity). one Shorthand for writing Vector2(1, 1). positiveInfinity Shorthand for writing Vector2(float.PositiveInfinity, float.PositiveInfinity). right Shorthand for writing Vector2(1, 0). up Shorthand for writing Vector2(0, 1). zero Shorthand for writing Vector2(0, 0).

## 변수

 magnitude Returns the length of this vector (Read Only). normalized Returns this vector with a magnitude of 1 (Read Only). sqrMagnitude Returns the squared length of this vector (Read Only). this[int] Access the x or y component using  or  respectively. x X component of the vector. y Y component of the vector.

## 생성자

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

## Public 함수

 Equals Returns true if the given vector is exactly equal to this vector. Normalize Makes this vector have a magnitude of 1. Set Set x and y components of an existing Vector2. ToString Returns a formatted string for this vector.

## 정적 함수

 Angle Returns the unsigned angle in degrees between from and to. ClampMagnitude Returns a copy of vector with its magnitude clamped to maxLength. Distance Returns the distance between a and b. Dot Dot Product of two vectors. Lerp Linearly interpolates between vectors a and b by t. LerpUnclamped Linearly interpolates between vectors a and b by t. 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. Perpendicular Returns the 2D vector perpendicular to this 2D vector. The result is always rotated 90-degrees in a counter-clockwise direction for a 2D coordinate system where the positive Y axis goes up. Reflect Reflects a vector off the vector defined by a normal. Scale Multiplies two vectors component-wise. SignedAngle Returns the signed angle in degrees between from and to. SmoothDamp Gradually changes a vector towards a desired goal over time.

## 연산자

 operator - Subtracts one vector from another. operator * Multiplies a vector by a number. operator / Divides a vector by a number. operator + Adds two vectors. operator == Returns true if two vectors are approximately equal. Vector2 Converts a Vector3 to a Vector2. Vector3 Converts a Vector2 to a Vector3.
{"ft_lang_label":"__label__en","ft_lang_prob":0.7869929,"math_prob":0.9523471,"size":2708,"snap":"2020-45-2020-50","text_gpt3_token_len":668,"char_repetition_ratio":0.17159763,"word_repetition_ratio":0.07881773,"special_character_ratio":0.23227474,"punctuation_ratio":0.12266112,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9971651,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-11-26T19:14:12Z\",\"WARC-Record-ID\":\"<urn:uuid:b77f7d73-f0e6-4b83-935d-4740198bf6a0>\",\"Content-Length\":\"20831\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:40d7b0b5-afdf-4d71-8ed9-4d08808af873>\",\"WARC-Concurrent-To\":\"<urn:uuid:cae6d5c7-e474-4a50-aa49-0dc8998b0386>\",\"WARC-IP-Address\":\"104.199.36.179\",\"WARC-Target-URI\":\"https://docs.unity3d.com/kr/2020.2/ScriptReference/Vector2.html\",\"WARC-Payload-Digest\":\"sha1:RGBVRGZ6BTXDDG4X6EU2XUOKTHMXDV2K\",\"WARC-Block-Digest\":\"sha1:XIBSVHTBZRPRA56Q5NIG5TOZYOII2IUP\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141188899.42_warc_CC-MAIN-20201126171830-20201126201830-00137.warc.gz\"}"}