This commit is contained in:
账号名 2024-03-08 14:04:19 +08:00
parent c4ae42efed
commit 0a683395d9
5 changed files with 56 additions and 3 deletions

View File

@ -0,0 +1,41 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class YHRemovecollider : Editor
{
[MenuItem("YH/Removesomething")]
public static void Removecollider()
{
Transform[] oos = Selection.transforms;
for (int i = 0; i < oos.Length; i++)
{
if (oos[i].childCount > 0)
{
SphereCollider[] meshscolliders = oos[i].GetComponentsInChildren<SphereCollider>();
Animator[] ani = oos[i].GetComponentsInChildren<Animator>();
for (int j = 0; j < meshscolliders.Length; j++)
{
Debug.Log(meshscolliders[j].name + "collider");
DestroyImmediate(meshscolliders[j]);
}
for (int a = 0; a < ani.Length; a++)
{
Debug.Log(ani[a].name + "Animator");
DestroyImmediate(ani[a]);
}
}
else
{
DestroyImmediate(oos[i].GetComponent<SphereCollider>());
DestroyImmediate(oos[i].GetComponent<Animator>());
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 810e5ed512c1f404aad2643619f13142
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -10023,6 +10023,7 @@ MonoBehaviour:
minCamera: {fileID: 1822639428928488196}
imageprs: {fileID: 8234605787508067104}
rawImage: {fileID: 2648302242586125239}
Mapsize: 0
colliders: []
attackColliders1: []
--- !u!54 &916690897

View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 1113159741}
m_IndirectSpecularColor: {r: 0.16220906, g: 0.30600852, b: 0.66929173, a: 1}
m_IndirectSpecularColor: {r: 0.16206118, g: 0.30587417, b: 0.6695679, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@ -53184,7 +53184,7 @@ Camera:
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Bits: 32567
m_RenderingPath: -1
m_TargetTexture: {fileID: 8400000, guid: 573e6faa88d2ce44c9c6dfda7f6b7559, type: 2}
m_TargetDisplay: 0
@ -70094,7 +70094,7 @@ MonoBehaviour:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
randSeed: 114122218
randSeed: 90461718
isDoingTransition: 0
minimumHeight: 0
--- !u!114 &1820978574