Tanoda
pb_EditorComponentAttribute.cs
Go to the documentation of this file.
1using UnityEngine;
2using System;
3
4namespace GILES
5{
12 [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
13 public class pb_EditorComponentAttribute : Attribute
14 {
15 public static void StripEditorComponents(GameObject target)
16 {
17 foreach(Component component in target.GetComponents<Component>())
18 {
19 if(component != null && Attribute.GetCustomAttribute(component.GetType(), typeof(pb_EditorComponentAttribute)) != null )
20 pb_ObjectUtility.Destroy(component);
21 }
22 }
23 }
24}
UnityEngine.Component Component
static void StripEditorComponents(GameObject target)