Пример #1
0
        public void CreateBrother()
        {
            var brother = WindowFactory.Clone().transform as RectTransform;

            brother.SetParent(transform.parent, false);
            brother.offsetMin = (transform as RectTransform).offsetMin + new Vector2(80, -80f);
            brother.offsetMax = (transform as RectTransform).offsetMax + new Vector2(80, -80f);

            _parent.PushState(brother.GetComponent <StackStateMachine>());
            brother.GetComponent <Window>()._parent = _parent;
        }
Пример #2
0
        public void CreateChild()
        {
            var child = WindowFactory.Clone().transform as RectTransform;

            child.SetParent(_content, false);

            var self = GetComponent <StackStateMachine>();

            self.PushState(child.GetComponent <StackStateMachine>());
            child.GetComponent <Window>()._parent = self;
        }