Vector2.operator / 运算符 除法


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

Description描述

Divides a vector by a number.

一个向量除以一个数字。也就是a/b。

Divides each component of a by a number d.  

用数字d除a的每一个组件。也就是a的每一个组件分别除以b。

  • 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 shorter: prints (0.5,1.0)// 使该向量缩小一半 : 打印(0.5,1.0)print (Vector2(1,2) / 2.0);


,