コード例 #1
0
ファイル: Window.cs プロジェクト: poup/ankagaja
        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
ファイル: Window.cs プロジェクト: poup/ankagaja
        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;
        }