Vector2.Scale   缩放


function Scale (scale : Vector2) : void

Description描述

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

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

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

Description描述

Multiplies two vectors component-wise.

两个矢量组件对应相乘。

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

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

  • C#

  • JavaScript

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


,