Collider Collision 区别

简介: Collision 中带有碰撞的信息,例如:速度和撞击到的点 示例 void OnCollisionEnter2D(Collision2D coll) { foreach(ContactPoint contact in coll.

Collision 中带有碰撞的信息,例如:速度和撞击到的点

示例

 void OnCollisionEnter2D(Collision2D coll) 
{
    foreach(ContactPoint contact in coll.contacts)

{
         contact.point;//
   } 
}

Collider是受影响的对象

示例

 void OnTriggerEnter2D(Collider2D other) 
{
      other.gameObject.transform.position;
}
相关文章
|
30天前
|
存储 API C++
【Qt 信号槽】深入探索 Qt 信号和槽机制中的引用传递“ (“A Deep Dive into Reference Passing in Qt Signal and Slot Mechanism“)
【Qt 信号槽】深入探索 Qt 信号和槽机制中的引用传递“ (“A Deep Dive into Reference Passing in Qt Signal and Slot Mechanism“)
48 0
|
6月前
SAP ABAP Lock 的 Collision Check 机制介绍
SAP ABAP Lock 的 Collision Check 机制介绍
22 0
|
7月前
|
人工智能 算法 C语言
Balanced Remainders(枚举)
Balanced Remainders(枚举)
19 0
TypeError: can‘t subtract offset-naive and offset-aware datetimes
TypeError: can‘t subtract offset-naive and offset-aware datetimes
|
自然语言处理 算法
PCFG中inside和outside算法详解
inside-outside算法是用来预测一棵句法分析树的概率的算法,算法建立在文法是乔姆斯基范式(CFG)的基础之上,CFG的定义见维基百科。一棵句法分析树的potential定义为它包含的产生式的potential乘积,在PCFG中表示概率,在CRF-CFG中表示特征集合的分数。
207 0
PCFG中inside和outside算法详解
⚡可行梯度方向法⚡(Feasible Gradient Direction Method ,FGDM)
⚡可行梯度方向法⚡(Feasible Gradient Direction Method ,FGDM)
⚡可行梯度方向法⚡(Feasible Gradient Direction Method ,FGDM)
|
算法 C# 索引
算法题丨Move Zeroes
描述 Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.
1133 0
|
人工智能
The left-hand side of an assignment must be a variable
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545} p.p2 {margin: 0.
1173 0