public static void CreateDragOrigin() { WhenUiObjectSelected(parent => { UiObjectUtil.CreateUiObject <Image, DragOrigin>("Drag Origin", parent, Vector2.zero, (a, b) => { a.color = Color.red; Logging.Warning <DragOrigin>("Need to set the draggable icon prefab"); }, PositionIsFixed: false); }); }
public static void CreateDraggableIcon() { WhenUiObjectSelected(parent => { UiObjectUtil.CreateUiObject <DraggableIcon>( "Draggable Icon", parent, Vector2.zero, dIcon => dIcon._PivotPoint = _CentrePivot, PositionIsFixed: false ); }); }
public static void CreateDragToTarget_TargetImage() { WhenUiObjectSelected(parent => { UiObjectUtil.CreateUiObject <DragToTarget, Image>( "Drag Target", parent, Vector2.zero, (target, img) => { target._SnapToTargetCentre = true; img.sprite = _TargetSprite; }, PositionIsFixed: false ); }); }
public static void CreateDragToTarget_Panel() { GameObject panel; WhenUiObjectSelected(parent => { panel = UiObjectUtil.CreateUiObject <Image, DragToTarget>( "Panel (Drag Target)", parent, Vector2.zero, (img, target) => { target._SnapToTargetCentre = true; img.sprite = _BackgroundSprite; img.type = Image.Type.Sliced; }, PositionIsFixed: false ); var image = panel.GetComponent <Image>(); image.color = _DefaultBackgroundColor; var rect = panel.GetComponent <RectTransform>(); rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, Screen.width); rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, Screen.height); }); }