ドキュメント

Unity Engine

Unity Engine

Scale

Multiplies two vectors component-wise.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

Scale(Vector4, Vector4)

Multiplies two vectors component-wise.
public static Vector4 Scale(Vector4 a, Vector4 b)

Parameters

The first vector to multiply.

The second vector to multiply.

Returns

Type

Description

Vector4A vector in which each component is the product of the corresponding components of
a
and
b
.

Remarks

Every component in the result is a component of
a
multiplied by the same component of
b
.

Examples

using UnityEngine;public class Example : MonoBehaviour{ void Start() { // prints (2.0,6.0,12.0,20.0) print(Vector4.Scale(new Vector4(1, 2, 3, 4), new Vector4(2, 3, 4, 5))); }}

Scale(Vector4, Vector4)

Multiplies two vectors component-wise.
public static Vector4 Scale(in Vector4 a, in Vector4 b)

Parameters

The first vector to multiply.

The second vector to multiply.

Returns

Type

Description

Vector4A vector in which each component is the product of the corresponding components of
a
and
b
.

Remarks

Every component in the result is a component of
a
multiplied by the same component of
b
.

Examples

using UnityEngine;public class Example : MonoBehaviour{ void Start() { // prints (2.0,6.0,12.0,20.0) print(Vector4.Scale(new Vector4(1, 2, 3, 4), new Vector4(2, 3, 4, 5))); }}

Scale(Vector4)

Multiplies every component of this vector by the same component of
scale
.
public void Scale(Vector4 scale)

Parameters

scale

The vector to multiply this vector by, component by component.

Scale(Vector4)

Multiplies every component of this vector by the same component of
scale
.
public void Scale(in Vector4 scale)

Parameters

scale

The vector to multiply this vector by, component by component.