Skip to content

Commit 600e821

Browse files
committed
Added check collider type util function.
1 parent e5386d1 commit 600e821

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Assets/JCSUnity/Scripts/JCS_ColliderObject.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ protected virtual void Awake()
5353
DetectColliderOnce();
5454
}
5555

56+
/// <summary>
57+
/// Identify the current collider type once.
58+
/// </summary>
59+
/// <returns>
60+
/// Type of the current collider.
61+
/// </returns>
5662
public JCS_ColliderType DetectColliderOnce()
5763
{
5864
this.mCharacterController = this.GetComponent<CharacterController>();
@@ -74,6 +80,19 @@ public JCS_ColliderType DetectColliderOnce()
7480
return this.mColliderType;
7581
}
7682

83+
/// <summary>
84+
/// Check if TYPE current collider type.
85+
/// </summary>
86+
/// <param name="type"> Collider type you want to confirm. </param>
87+
/// <returns>
88+
/// Return true, if TYPE is this collider type.
89+
/// Return false, if TYPE isn't this collider type.
90+
/// </returns>
91+
public bool IsColliderType(JCS_ColliderType type)
92+
{
93+
return this.mColliderType == type;
94+
}
95+
7796
public Vector3 center
7897
{
7998
get

0 commit comments

Comments
 (0)