Vector3.operator * 运算符 乘法


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

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 Vector3(1, 2, 3) * 2.0F);}}
// make the vector twice longer: prints (2.0,4.0,6.0)//使该向量变长2倍print (Vector3(1,2,3) * 2.0);

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

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 Vector3(1, 2, 3));}}
// make the vector twice longer: prints (2.0,4.0,6.0)//使该向量变长2倍print (2.0 * Vector3(1,2,3));


,