Scale
Multiplies two vectors component-wise.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
Scale(Vector3, Vector3)
Multiplies two vectors component-wise.
public static Vector3 Scale(Vector3 a, Vector3 b)
Parameters
Returns
Type | Description |
|---|---|
| Vector3 | A component of |
Remarks
Every component in the result is a component of multiplied by the same component of .
abExamples
// Calculate the two vectors generating a result.// This will compute Vector3(2, 6, 12)using UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour{ void Example() { print(Vector3.Scale(new Vector3(1, 2, 3), new Vector3(2, 3, 4))); }}
Scale(Vector3, Vector3)
Multiplies two vectors component-wise.
public static Vector3 Scale(in Vector3 a, in Vector3 b)
Parameters
Returns
Type | Description |
|---|---|
| Vector3 | A component of |
Remarks
Every component in the result is a component of multiplied by the same component of .
abExamples
// Calculate the two vectors generating a result.// This will compute Vector3(2, 6, 12)using UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour{ void Example() { print(Vector3.Scale(new Vector3(1, 2, 3), new Vector3(2, 3, 4))); }}
Scale(Vector3)
Multiplies every component of this vector by the same component of .
scalepublic void Scale(Vector3 scale)
Parameters
The vector to multiply by.
Scale(Vector3)
Multiplies every component of this vector by the same component of .
scalepublic void Scale(in Vector3 scale)
Parameters
The vector to multiply by.