/// <summary> /// Adds a hidden behaviour. /// </summary> public HiddenBehaviour AddHiddenComponent(System.Type type) { HiddenBehaviour t = (HiddenBehaviour)gameObject.AddComponent(type); t.hideFlags = HideFlags.HideInInspector; t.ActionOwner = this; return(t); }
/// <summary> /// Adds a hidden behaviour. /// </summary> public HiddenBehaviour AddHiddenComponent(HiddenBehaviour oldComponent) { HiddenBehaviour t = (HiddenBehaviour)gameObject.AddComponent(oldComponent.GetType()); #if UNITY_EDITOR UnityEditor.EditorUtility.CopySerialized(oldComponent, t); #endif t.hideFlags = HideFlags.HideInInspector; t.ActionOwner = this; return(t); }