Skip to content

Commit

Permalink
remove auto-generated colliders (seems to be new in 2018?)
Browse files Browse the repository at this point in the history
  • Loading branch information
rms80 committed Oct 8, 2018
1 parent 1a279bb commit d25a41f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/UnityUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class UnityUtil
public static GameObject CreatePrimitiveGO(string name, PrimitiveType eType, Material setMaterial = null, bool bCollider = true)
{
var gameObj = GameObject.CreatePrimitive(eType);
if (gameObj.GetComponent<Collider>() != null)
Component.Destroy(gameObj.GetComponent<Collider>());
if (bCollider) {
gameObj.AddComponent(typeof(MeshCollider));
gameObj.DisableCollider();
Expand Down

0 comments on commit d25a41f

Please sign in to comment.