Skip to content

Commit

Permalink
Added check collider type util function.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jun 29, 2020
1 parent e5386d1 commit 600e821
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Assets/JCSUnity/Scripts/JCS_ColliderObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ protected virtual void Awake()
DetectColliderOnce();
}

/// <summary>
/// Identify the current collider type once.
/// </summary>
/// <returns>
/// Type of the current collider.
/// </returns>
public JCS_ColliderType DetectColliderOnce()
{
this.mCharacterController = this.GetComponent<CharacterController>();
Expand All @@ -74,6 +80,19 @@ public JCS_ColliderType DetectColliderOnce()
return this.mColliderType;
}

/// <summary>
/// Check if TYPE current collider type.
/// </summary>
/// <param name="type"> Collider type you want to confirm. </param>
/// <returns>
/// Return true, if TYPE is this collider type.
/// Return false, if TYPE isn't this collider type.
/// </returns>
public bool IsColliderType(JCS_ColliderType type)
{
return this.mColliderType == type;
}

public Vector3 center
{
get
Expand Down

0 comments on commit 600e821

Please sign in to comment.