Beispiel #1
0
        public void Initialize(Panel panel, Direction direction, PanelResizeHelper helperBefore, PanelResizeHelper helperAfter)
        {
            m_panel = panel;

            this.m_direction  = direction;
            this.helperBefore = helperBefore;
            this.helperAfter  = helperAfter;
        }
Beispiel #2
0
        public static void OnPointerEnter(PanelResizeHelper resizeHelper, PointerEventData eventData)
        {
            if (instance == null)
            {
                return;
            }

            instance.activeResizeHelper = resizeHelper;
            instance.activeEventData    = eventData;
        }
Beispiel #3
0
        private PanelResizeHelper GetResizeZone(Direction direction)
        {
            PanelResizeHelper resizeZone = resizeZones[(int)direction];

            if (resizeZone != null)
            {
                return(resizeZone);
            }

            resizeZone = new GameObject("ResizeZone" + direction, typeof(RectTransform)).AddComponent <PanelResizeHelper>();
            resizeZone.RectTransform.SetParent(resizeZonesParent, false);
            resizeZone.gameObject.AddComponent <NonDrawingGraphic>();

            resizeZones[(int)direction] = resizeZone;

            return(resizeZone);
        }
Beispiel #4
0
        public static void OnPointerExit(PanelResizeHelper resizeHelper)
        {
            if (instance == null)
            {
                return;
            }

            if (instance.activeResizeHelper == resizeHelper)
            {
                instance.activeResizeHelper = null;
                instance.activeEventData    = null;

                if (!instance.isResizing)
                {
                    SetDefaultCursor();
                }
            }
        }
Beispiel #5
0
        private PanelResizeHelper GetResizeZone(Direction direction)
        {
            PanelResizeHelper resizeZone = resizeZones[(int)direction];

            if (resizeZone != null)
            {
                return(resizeZone);
            }

            resizeZone = new GameObject("ResizeZone" + direction, typeof(RectTransform)).AddComponent <PanelResizeHelper>();
            resizeZone.RectTransform.SetParent(resizeZonesParent, false);

            Image background = resizeZone.gameObject.AddComponent <Image>();

            background.color  = Color.clear;
            background.sprite = Internal.BackgroundSprite;

            resizeZones[(int)direction] = resizeZone;

            return(resizeZone);
        }