Пример #1
0
        public virtual GUIObject removeChild(GUIObject obj)
        {
            if (obj == null)
                return null;

            return removeChild(obj.id());
        }
Пример #2
0
        public virtual bool addChild(GUIObject child)
        {
            if (!isReady() || !child.isReady() || child == null)
                return false;

            Debug.Assert(_children != null);

            try
            {
                _children.Add(child.id(), child);
            }
            catch (ArgumentException e)
            {
                Debug.LogException(e);
                Debug.LogError("Could not add child with id: " + child.id());

                Debug.LogError("Children Dump");
                foreach (string childId in _children.Keys)
                    Debug.LogError("Child id: " + child.id() + ", name: " + child.name());
            }
            child._parent = this;

            child._boxRect.SetParent(_boxRect);

            return true;
        }