operator *
Multiplies a vector by another vector.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Operator
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
operator *(Vector2, Vector2)
Multiplies a vector by another vector.
public static Vector2 operator *(Vector2 a, Vector2 b)
Parameters
Returns
Type | Description |
|---|---|
| Vector2 |
Remarks
Multiplies each component of by its matching component from .
aboperator *(Vector2, float)
Multiplies a vector by a number.
public static Vector2 operator *(Vector2 a, float d)
Parameters
Returns
Type | Description |
|---|---|
| Vector2 |
Remarks
Multiplies each component of by a number .
adExamples
using UnityEngine;public class Example : MonoBehaviour{ void Start() { // make the vector twice longer: prints (2.0,4.0) print(new Vector2(1, 2) * 2.0f); }}
operator *(float, Vector2)
Multiplies a vector by a number.
public static Vector2 operator *(float d, Vector2 a)
Parameters
Returns
Type | Description |
|---|---|
| Vector2 |
Remarks
Multiplies each component of by a number .
adExamples
using UnityEngine;public class Example : MonoBehaviour{ void Start() { // make the vector twice longer: prints (2.0,4.0) print(2.0f * new Vector2(1, 2)); }}