SphereCollider.center 中心

var center : Vector3

Description描述

The center of the sphere, measured in the object's local space.

球体的中心,基于物体的自身坐标空间。

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {collider.center = Vector3.zero;}}
// Reset the center to the transform's position//重置中心到变换的位置。collider.center = Vector3.zero;


,