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

            // 关联的Text组件
            InputComponent.textComponent = TextView.TextComponent;
        }
示例#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;
        }
示例#4
0
 public ButtonView(UILayout layout)
     : base(layout)
 {
     Button = UIObject.AddComponent <Button>();
 }
示例#5
0
 public ButtonView(RectTransform transform) : base(transform)
 {
     Button = UIObject.AddComponent <Button>();
 }
示例#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>();
 }
示例#7
0
 public UIView(UILayout layout) : base(layout)
 {
     CanvasRenderer = UIObject.AddComponent <CanvasRenderer>();
 }
示例#8
0
 public UIView(RectTransform transform) : base(transform)
 {
     CanvasRenderer = UIObject.AddComponent <CanvasRenderer>();
 }
示例#9
0
 public ScrollView() : base()
 {
     ScrollRect         = UIObject.AddComponent <ScrollRect>();
     ContentView        = new UIView();
     ScrollRect.content = ContentView.RectTransform;
 }
示例#10
0
 public TextView(UILayout layout)
     : base(layout)
 {
     TextComponent = UIObject.AddComponent <Text>();
     Font          = UIViewManager.GetInstance().Font;
 }
示例#11
0
 public ImageView()
 {
     ImageComponent = UIObject.AddComponent <Image>();
 }