Example #1
0
 public TextField(UILayout layout) : base(layout)
 {
     InputComponent = UIObject.AddComponent <InputField>();
     TextView       = new TextView(this);
     RectFill(TextView);
     InputComponent.textComponent = TextView.TextComponent;
 }
Example #2
0
        public TextField()
        {
            InputComponent = UIObject.AddComponent <InputField>();
            TextView       = new TextView(this);
            RectFill(TextView);

            // 关联的Text组件
            InputComponent.textComponent = TextView.TextComponent;
        }
Example #3
0
        protected AbsAdapterView()
        {
            ScrollRect = UIObject.AddComponent <ScrollRect>();
            ScrollRect.onValueChanged.AddListener(OnScroll);
            EventHandler = UIObject.AddComponent <PointerClickHandler>();
            EventHandler.AbsAdapterView = this;
            var contentView = new UILayout {
                UIObject = { name = "Content View" }
            };

            AddSubview(contentView);
            ContentTransform                  = contentView.RectTransform;
            ContentTransform.pivot            = ContentTransform.anchorMin = ContentTransform.anchorMax = new Vector2(0, 1);
            ContentTransform.anchoredPosition = Vector2.zero;
            ScrollRect.content                = ContentTransform;

            ScrollOrentation = ScrollOrentation.Vertical;

            BackgroundColor      = Color.black;
            Mask                 = UIObject.AddComponent <Mask>();
            Mask.showMaskGraphic = true;
        }
Example #4
0
 public ButtonView(UILayout layout)
     : base(layout)
 {
     Button = UIObject.AddComponent <Button>();
 }
Example #5
0
 public ButtonView(RectTransform transform) : base(transform)
 {
     Button = UIObject.AddComponent <Button>();
 }
Example #6
0
 private UICanvas() : base(Object.FindObjectOfType <Canvas>().gameObject ?? new GameObject("Canvas"))
 {
     Canvas           = UIObject.GetComponent <Canvas>() ?? UIObject.AddComponent <Canvas>();
     CanvasScaler     = UIObject.GetComponent <CanvasScaler>() ?? UIObject.AddComponent <CanvasScaler>();
     GraphicRaycaster = UIObject.GetComponent <GraphicRaycaster>() ?? UIObject.AddComponent <GraphicRaycaster>();
 }
Example #7
0
 public UIView(UILayout layout) : base(layout)
 {
     CanvasRenderer = UIObject.AddComponent <CanvasRenderer>();
 }
Example #8
0
 public UIView(RectTransform transform) : base(transform)
 {
     CanvasRenderer = UIObject.AddComponent <CanvasRenderer>();
 }
Example #9
0
 public ScrollView() : base()
 {
     ScrollRect         = UIObject.AddComponent <ScrollRect>();
     ContentView        = new UIView();
     ScrollRect.content = ContentView.RectTransform;
 }
Example #10
0
 public TextView(UILayout layout)
     : base(layout)
 {
     TextComponent = UIObject.AddComponent <Text>();
     Font          = UIViewManager.GetInstance().Font;
 }
Example #11
0
 public ImageView()
 {
     ImageComponent = UIObject.AddComponent <Image>();
 }