-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from MrTrueChina/1.0.1-禁用碰撞器后延迟取消碰撞功能
修改移除碰撞器为延迟到下一次检测时执行
- Loading branch information
Showing
30 changed files
with
1,062 additions
and
143 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions
20
Assets/Quadtree Collider Detection/Tests/03 Delay Disable/DestroyOnCollisionEnter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace MtC.Tools.QuadtreeCollider.Test | ||
{ | ||
/// <summary> | ||
/// 当发生碰撞时销毁物体的组件,用于测试延迟禁用碰撞器的功能 | ||
/// </summary> | ||
[RequireComponent(typeof(CircleQuadtreeCollider))] | ||
public class DestroyOnCollisionEnter : MonoBehaviour, IOnQuadtreeCollisionEnter | ||
{ | ||
public void OnQuadtreeCollisionEnter(QuadtreeCollider collider) | ||
{ | ||
Destroy(gameObject); | ||
|
||
Debug.Log(gameObject.name + " 销毁"); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
Assets/Quadtree Collider Detection/Tests/03 Delay Disable/DisableColliderOnCollisionEnter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace MtC.Tools.QuadtreeCollider.Test | ||
{ | ||
/// <summary> | ||
/// 当发生碰撞时禁用碰撞器的组件,用于测试延迟禁用碰撞器的功能 | ||
/// </summary> | ||
[RequireComponent(typeof(CircleQuadtreeCollider))] | ||
public class DisableColliderOnCollisionEnter : MonoBehaviour, IOnQuadtreeCollisionEnter | ||
{ | ||
public void OnQuadtreeCollisionEnter(QuadtreeCollider collider) | ||
{ | ||
GetComponent<CircleQuadtreeCollider>().enabled = false; | ||
|
||
Debug.Log(gameObject.name + " 禁用碰撞器"); | ||
} | ||
} | ||
} |
Oops, something went wrong.