FairyGUI.RelationItem.Add C# (CSharp) Method

Add() public method

public Add ( RelationType relationType, bool usePercent ) : void
relationType RelationType
usePercent bool
return void
        public void Add(RelationType relationType, bool usePercent)
        {
            if (relationType == RelationType.Size)
            {
                Add(RelationType.Width, usePercent);
                Add(RelationType.Height, usePercent);
                return;
            }

            int dc = _defs.Count;
            for (int k = 0; k < dc; k++)
            {
                if (_defs[k].type == relationType)
                    return;
            }

            InternalAdd(relationType, usePercent);
        }

Usage Example

Example #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="target"></param>
 /// <param name="relationType"></param>
 /// <param name="usePercent"></param>
 public void Add(GObject target, RelationType relationType, bool usePercent)
 {
     foreach (RelationItem item in _items)
     {
         if (item.target == target)
         {
             item.Add(relationType, usePercent);
             return;
         }
     }
     RelationItem newItem = new RelationItem(_owner);
     newItem.target = target;
     newItem.Add(relationType, usePercent);
     _items.Add(newItem);
 }
All Usage Examples Of FairyGUI.RelationItem::Add