removecomponents
This commit is contained in:
1 parent
d7672612cc
commit
828a8e963e
4 files changed
+51
No files matched your search
@@ -0,0 +1,12 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class RemoveComponentName : MonoBehaviour {
|
||||
public void RemoveComponents () {
|
||||
MeshRenderer[] meshes = GetComponentsInChildren<MeshRenderer>();
|
||||
foreach (MeshRenderer c in meshes) {
|
||||
DestroyImmediate(c, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 972bb8f02cd29a544b2ccd68181fa8c7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor (typeof (RemoveComponentName))]
|
||||
public class RemoveComponentNameEditor : Editor {
|
||||
public override void OnInspectorGUI () {
|
||||
DrawDefaultInspector ();
|
||||
|
||||
RemoveComponentName rmc = (RemoveComponentName) target;
|
||||
|
||||
if (GUILayout.Button ("Remove ComponentName")) {
|
||||
rmc.RemoveComponents ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31c90ce24336b0223aec0a24fc93d896
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user