public TextField(UILayout layout) : base(layout) { InputComponent = UIObject.AddComponent <InputField>(); TextView = new TextView(this); RectFill(TextView); InputComponent.textComponent = TextView.TextComponent; }
public TextField() { InputComponent = UIObject.AddComponent <InputField>(); TextView = new TextView(this); RectFill(TextView); // 关联的Text组件 InputComponent.textComponent = TextView.TextComponent; }
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; }
public ButtonView(UILayout layout) : base(layout) { Button = UIObject.AddComponent <Button>(); }
public ButtonView(RectTransform transform) : base(transform) { Button = UIObject.AddComponent <Button>(); }
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>(); }
public UIView(UILayout layout) : base(layout) { CanvasRenderer = UIObject.AddComponent <CanvasRenderer>(); }
public UIView(RectTransform transform) : base(transform) { CanvasRenderer = UIObject.AddComponent <CanvasRenderer>(); }
public ScrollView() : base() { ScrollRect = UIObject.AddComponent <ScrollRect>(); ContentView = new UIView(); ScrollRect.content = ContentView.RectTransform; }
public TextView(UILayout layout) : base(layout) { TextComponent = UIObject.AddComponent <Text>(); Font = UIViewManager.GetInstance().Font; }
public ImageView() { ImageComponent = UIObject.AddComponent <Image>(); }