Skip to content

BoxCollider (JavaScript)

BoxCollider

Scripting Name:Insight.BoxCollider

盒形碰撞器。

Properties


center

type :Insight.Vector3

(只读)碰撞器中心点相对于所依附 GameObject 的局部坐标。

size

type : Insight.Vector3

(只读)碰撞器的长宽高(基于局部坐标系)。

Methods


toString

public string toString();

将 collider 内容以一定格式转为 string 类型。

// sample:
var collider = gameobject.getComponent("BoxCollider", 0);Insight.Debug.Log(collider.toString());

Inherited Properties(继承自 Collider)


isTrigger

type :boolean

(只读)是否为触发器。触发器只参与 RayCast,不参与物理计算。

enabled

type : boolean

该组件是否是可用的。

gameObject

type : Insight.GameObject

(只读)该组件所依附的 GameObject。

isActiveAndEnabled

type : boolean

(只读)该组件是否可用,且其依附的 GameObject 是否是活跃状态。

name

type : string

(只读)所依附的 GameObject 的名称。

tag

type : string

(只读)所依附的 GameObject 的 Tag。

⚠️ 暂时未启用

transform

type : Insight.Transform

(只读)所依附的 GameObject 的 transform。