Exemplo n.º 1
0
    /// <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);
    }
Exemplo n.º 2
0
    /// <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);
    }