//判断是否当前Collider bool IsColliderActive(TurtleColliderType type) { if (type == TurtleColliderType.None) { return(false); } return(colliders[(int)type] == m_currentCollider); }
//激活Collider void ActiveCollider(TurtleColliderType type) { //先关闭所有Collider for (var i = 0; i < colliders.Length; i++) { colliders[i].enabled = false; onHitBoxes[i].gameObject.SetActive(false); } Collider2D co = colliders[(int)type]; onHitBoxes[(int)type].gameObject.SetActive(true); co.enabled = true; m_currentCollider = co; }