Vector3.Scale 缩放


function Scale (scale : Vector3) : void

Description描述

Multiplies every component of this vector by the same component of scale.

由缩放的相同的组件对应乘以这个矢量的每个组件。

• static function Scale (a : Vector3, b : Vector3) : Vector3

Description描述

Multiplies two vectors component-wise.

两个矢量组件对应相乘。

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

结果每个组件是有相同名字a的组件(axa)和相同名字b的组件(bxb)分别相乘。

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {print(Vector3.Scale(new Vector3(1, 2, 3), new Vector3(2, 3, 4)));}}
// prints (2.0,6.0,12.0)print (Vector3.Scale (Vector3(1,2,3), Vector3(2,3,4)));


,