FairyGUI.RelationItem.Remove C# (CSharp) Method

Remove() public method

public Remove ( RelationType relationType ) : void
relationType RelationType
return void
        public void Remove(RelationType relationType)
        {
            if (relationType == RelationType.Size)
            {
                Remove(RelationType.Width);
                Remove(RelationType.Height);
                return;
            }

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

Usage Example

Example #1
0
        public void Remove(GObject target, RelationType relationType)
        {
            int cnt = _items.Count;
            int i   = 0;

            while (i < cnt)
            {
                RelationItem item = _items[i];
                if (item.target == target)
                {
                    item.Remove(relationType);
                    if (item.isEmpty)
                    {
                        item.Dispose();
                        _items.RemoveAt(i);
                        cnt--;
                        continue;
                    }
                    else
                    {
                        i++;
                    }
                }
                i++;
            }
        }