public RectContainerElement( IUIDynamicElement inSource, Transform groupParent, DragElementContainerBoundary boundaryMode) { _source = inSource; _boundaryMode = boundaryMode; _source.SubscribeDynamicElementListener(this); _group = RectContainerGroup.GetOrCreateGroup(groupParent); _group?.RegisterContainerElement(this); }
public void SetContainerType( DragElementContainerType containerType, RectTransform container, IUIDynamicElement dynamicContainer) { _explicitContainer = container; _dynamicContainer = dynamicContainer; _containerType = containerType; switch (_containerType) { case DragElementContainerType.Screen: case DragElementContainerType.SafeArea: _containerSpace = new RectSpace(RectBoundariesUtility.GetScreenCorners()); GourdUI.Device.RegisterScreenUpdateListener(this); break; case DragElementContainerType.Parent: _containerSpace = new RectSpace(_explicitContainer); _dynamicContainer?.SubscribeDynamicElementListener(this); break; } _currentElementFreeSpaces.Add(_containerSpace); }