static void Cleanup(SAMeshColliderBuilder meshColliderBuilder) { if (meshColliderBuilder == null) { Debug.LogError(""); return; } MeshFilter[] meshFilters = SAColliderBuilderEditorCommon.GetMeshFilters(meshColliderBuilder.gameObject); SkinnedMeshRenderer[] skinnedMeshRenderers = SAColliderBuilderEditorCommon.GetSkinnedMeshRenderers(meshColliderBuilder.gameObject); if ((meshFilters == null || meshFilters.Length == 0) && (skinnedMeshRenderers == null || skinnedMeshRenderers.Length == 0)) { Debug.LogError("Nothing MeshFilter/SkinnedMeshRenderer. Skip Cleanuping."); return; } if (meshFilters != null) { foreach (MeshFilter meshFilter in meshFilters) { SAMeshColliderEditorCommon.CleanupChildSAMeshColliders(meshFilter.gameObject, meshColliderBuilder.cleanupModified); } } if (skinnedMeshRenderers != null) { foreach (SkinnedMeshRenderer skinnedMeshRenderer in skinnedMeshRenderers) { SAMeshColliderEditorCommon.CleanupChildSAMeshColliders(skinnedMeshRenderer.gameObject, meshColliderBuilder.cleanupModified); } } }
static void Cleanup(SAMeshCollider meshCollider) { if (meshCollider == null) { Debug.LogError(""); return; } SAMeshColliderEditorCommon.CleanupChildSAMeshColliders( meshCollider.gameObject, meshCollider.cleanupModified); SAMeshColliderEditorCommon.CleanupSelfSAMeshCollider(meshCollider); SAMeshColliderEditorCommon.MarkManualProcessingToParent(meshCollider); }
static void Process(SAMeshColliderBuilder meshColliderBuilder) { if (meshColliderBuilder == null) { Debug.LogError(""); return; } MeshFilter[] meshFilters = SAColliderBuilderEditorCommon.GetMeshFilters(meshColliderBuilder.gameObject); SkinnedMeshRenderer[] skinnedMeshRenderers = SAColliderBuilderEditorCommon.GetSkinnedMeshRenderers(meshColliderBuilder.gameObject); if ((meshFilters == null || meshFilters.Length == 0) && (skinnedMeshRenderers == null || skinnedMeshRenderers.Length == 0)) { Debug.LogError("Nothing MeshFilter/SkinnedMeshRenderer. Skip Processing."); return; } List <ReducerTask> reducerTasks = new List <ReducerTask>(); if (meshFilters != null) { foreach (MeshFilter meshFilter in meshFilters) { Mesh mesh = SAColliderBuilderEditorCommon.GetMesh(meshFilter); Material[] materials = SAColliderBuilderEditorCommon.GetMaterials(meshFilter); MeshCache meshCahce = new MeshCache(mesh, materials); SAMeshColliderEditorCommon.CleanupChildSAMeshColliders(meshFilter.gameObject, meshColliderBuilder.cleanupModified); ProcessRoot(reducerTasks, meshCahce, meshColliderBuilder, meshFilter.gameObject); } } if (skinnedMeshRenderers != null) { foreach (SkinnedMeshRenderer skinnedMeshRenderer in skinnedMeshRenderers) { Mesh mesh = SAColliderBuilderEditorCommon.GetMesh(skinnedMeshRenderer); Material[] materials = SAColliderBuilderEditorCommon.GetMaterials(skinnedMeshRenderer); MeshCache meshCahce = new MeshCache(mesh, materials); SAMeshColliderEditorCommon.CleanupChildSAMeshColliders(skinnedMeshRenderer.gameObject, meshColliderBuilder.cleanupModified); ProcessRoot(reducerTasks, meshCahce, meshColliderBuilder, skinnedMeshRenderer.gameObject); } } SAMeshColliderEditorCommon.Reduce(reducerTasks, meshColliderBuilder.isDebug); }