Example #1
0
 public SiAccess(uint accessMask, string displayName, InheritFlags flags)
 {
     this.AccessMask  = accessMask;
     this.DisplayName = displayName;
     InheritanceFlags = flags;
     pGuid            = IntPtr.Zero;
 }
Example #2
0
    static void ApplyFlagsRecursive(
        InheritFlags inheritFlags,
        int layer,
        string tag,
        int staticFlags,
        Transform trans
        )
    {
        bool dirty = false;

        GameObject to = trans.gameObject;

        if (0 != (inheritFlags & InheritFlags.Layer))
        {
            if (to.layer != layer)
            {
                dirty    = true;
                to.layer = layer;
            }
        }

        if (0 != (inheritFlags & InheritFlags.Tag))
        {
            if (!to.CompareTag(tag))
            {
                dirty  = true;
                to.tag = tag;
            }
        }

#if UNITY_EDITOR
        if (0 != (inheritFlags & InheritFlags.StaticFlags))
        {
            var flags     = (StaticEditorFlags)staticFlags;
            var currFlags = GameObjectUtility.GetStaticEditorFlags(to);

            if (flags != currFlags)
            {
                dirty = true;
                GameObjectUtility.SetStaticEditorFlags(to, flags);
            }
        }

        if (dirty)
        {
            EditorUtility.SetDirty(to);
        }
#endif // UNITY_EDITOR

        for (int i = 0; i < trans.childCount; ++i)
        {
            Transform child = trans.GetChild(i);
            ApplyFlagsRecursive(
                inheritFlags,
                layer,
                tag,
                staticFlags,
                child
                );
        }
    }
 /// <summary>Initializes a new instance of the <see cref="InheritTypeInfo"/> struct.</summary>
 /// <param name="flags">The inheritance flags.</param>
 /// <param name="name">The display name.</param>
 public InheritTypeInfo(InheritFlags flags, string name)
 {
     guidObjectType = NativeMethods.EmptyGuidPtr;
     Flags          = flags;
     Name           = name;
 }
 /// <summary>Initializes a new instance of the <see cref="InheritTypeInfo"/> struct.</summary>
 /// <param name="childObjectType">Type of the child object.</param>
 /// <param name="flags">The inheritance flags.</param>
 /// <param name="name">The display name.</param>
 public InheritTypeInfo(Guid childObjectType, InheritFlags flags, string name)
     : this(flags, name)
 {
     ChildObjectTypeId = childObjectType;
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InheritTypeInfo"/> struct.
 /// </summary>
 /// <param name="flags">The inheritance flags.</param>
 /// <param name="name">The display name.</param>
 public InheritTypeInfo(InheritFlags flags, string name)
 {
     this.guidObjectType = Helper.EmptyGuidPtr;
     this.Flags          = flags;
     this.Name           = name;
 }