Пример #1
0
        public FlexibleLayout(Transform parent, float maxWidth, float ySpacing)
        {
            this.parent   = parent;
            this.maxWidth = maxWidth;
            this.ySpacing = ySpacing;

            overflowChecker = new LayoutOverflowChecker(parent, maxWidth);
        }
Пример #2
0
        public void TestOverflow()
        {
            GameObject parent = new GameObject();

            CreateGameObjects(parent);

            var overflowChecker = new LayoutOverflowChecker(parent.transform, 5);

            Assert.That(overflowChecker.IsOverflowX());

            overflowChecker = new LayoutOverflowChecker(parent.transform, 3);

            Assert.That(overflowChecker.IsOverflowX());

            overflowChecker = new LayoutOverflowChecker(parent.transform, 15);
            Assert.That(!overflowChecker.IsOverflowX());
        }