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); }
void IScreenRectUpdateListener.OnScreenRectUpdated(Rect rect) { _containerSpace = new RectSpace(RectBoundariesUtility.GetScreenCorners()); _source.ForceUpdate(); }