コード例 #1
0
 public ModLayoutManager(LayoutGroup layout, UIStyleManager styleManager, ModUIStyleApplier styleApplier,
                         Vector3 scale, Graphic[] constantGraphics, Graphic[] backGraphics)
     : this(layout, styleManager, styleApplier, scale, constantGraphics)
 {
     backGraphics.ToList().ForEach(element => _backingGraphics.Add(element));
     styleApplier.SetBackground(backGraphics);
 }
コード例 #2
0
        public ModLayoutManager(LayoutGroup layout, UIStyleManager styleManager, ModUIStyleApplier styleApplier, Vector3 scale)
        {
            _scale        = scale;
            _styleManager = styleManager;
            _styleApplier = styleApplier;
            LayoutGroup   = layout;
            LayoutGroup.childAlignment          = TextAnchor.MiddleCenter;
            LayoutGroup.transform.localPosition = Vector3.zero;
            var rectTransform = (RectTransform)LayoutGroup.transform;

            rectTransform.pivot = NormalPivot;
            UpdateState();
        }
コード例 #3
0
ファイル: ModLayoutButton.cs プロジェクト: TAImatem/owml
        public ModLayoutButton(Button button, IModMenu menu) : base(button, menu)
        {
            var scale = button.transform.localScale;

            Object.Destroy(Button.GetComponentInChildren <Text>(true).gameObject);
            var layoutObject = new GameObject("LayoutGroup", typeof(RectTransform));

            layoutObject.transform.SetParent(button.transform);
            var target = layoutObject.AddComponent <Image>();

            target.raycastTarget = true;
            target.color         = Color.clear;
            var layoutGroup = layoutObject.AddComponent <HorizontalLayoutGroup>();

            Initialize(menu);
            layoutGroup.childControlWidth      = false;
            layoutGroup.childControlHeight     = false;
            layoutGroup.childForceExpandHeight = false;
            layoutGroup.childForceExpandWidth  = false;
            var styleManager = Object.FindObjectOfType <UIStyleManager>();
            var styleApplier = ModUIStyleApplier.ReplaceStyleApplier(Button.gameObject);

            Layout = new ModLayoutManager(layoutGroup, styleManager, styleApplier, scale);
        }
コード例 #4
0
 public ModLayoutManager(LayoutGroup layout, UIStyleManager styleManager, ModUIStyleApplier styleApplier,
                         Vector3 scale, Graphic[] constantGraphics)
     : this(layout, styleManager, styleApplier, scale)
 {
     constantGraphics.ToList().ForEach(element => _constantGraphics.Add(element));
 }