Vector2.operator * 运算符 乘法


static operator * (a : Vector2, d : float) : Vector2

Description描述

Multiplies a vector by a number.

一个数字乘以一个向量。

Multiplies each component of a by a number d.  

数字d乘以a的每一个组件。

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {print(new Vector2(1, 2) * 2.0F);}}
// make the vector twice longer: prints (2.0,4.0)// 使该向量变为两倍长:prints (2.0,4.0)print (Vector2(1,2) * 2.0);

• static operator * (d : float, a : Vector2) : Vector2

Description描述

Multiplies a vector by a number.

一个数字乘以一个向量。

Multiplies each component of a by a number d.

数字d乘以a的每一个组件。

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {print(2.0F * new Vector2(1, 2));}}
// make the vector twice longer: prints (2.0,4.0)// 使该向量变为两倍长:prints (2.0,4.0)print (2.0 * Vector2(1,2));


,