using UnityEngine; using System.Collections; public static class ExtensionCollider { public static void SetCollider(this Component comp, bool active) { BoxCollider2D collider = comp.GetComponent(); if (collider) { collider.enabled = active; } } public static void SetCollider(this GameObject gameObject, bool active) { gameObject.GetComponent().enabled = active; } }