#if UNITY_EDITOR using UnityEngine; using Sabresaurus.SabreCSG; public static class BSPTreePostProcess { [PostProcessCSGBuild] public static void OnPostProcessCSGBuild(Transform meshGroup) { if(meshGroup != null) { // Grab all the built mesh colliders MeshCollider[] colliders = meshGroup.GetComponentsInChildren(); // Add a SuperCharacterController BSPTree to each collider for (int i = 0; i < colliders.Length; i++) { colliders[i].gameObject.AddComponent(); } } } } #endif