示例#1
0
        internal void Select(DisplayObject target)
        {
            var dlm = target as DisplayListMember;

            // do not analyze anything from this stage
            if (null != dlm && !DesignerOverlay.IsInspectable(dlm))
            {
                return;
            }

            var go = GuiLookup.GetGameObject((Component)target);

            if (null != go)
            {
                _selectionOverlay.Visible = true;
                var bounds = target.Transform.GlobalBounds;

                /**
                 * 1. Expand around component
                 * */
                bounds = bounds.Expand(PlayModeOverlaySelectionBorderStyle.BorderWidth);

                /**
                 * 2. Constrain with stage bounds
                 * */
                bounds.ConstrainWithin(Rectangle.FromSize(SystemManager.Instance.ScreenSize));

                _selectionOverlay.Redraw(bounds, Bounds, GuiLookup.PathToString(go.transform, " -> "));
                _selectionOverlay.ValidateNow();
            }
        }
示例#2
0
        void OnDisable()
        // ReSharper restore UnusedMember.Local
        {
#if DEBUG
            if (DebugMode)
            {
                Debug.Log("DesignerOverlay disabled");
            }
#endif
            TurnOff();
            _instance = null;
            SystemManager.Instance.DisposingSignal.Disconnect(DisposingSlot);
        }
示例#3
0
 /// <summary>
 /// Attaches the designer overlay component to eDriven framework object
 /// </summary>
 public static void Attach()
 {
     // ReSharper disable once UnusedVariable
     DesignerOverlay overlay = (DesignerOverlay)Framework.GetComponent <DesignerOverlay>(true); // add if non-existing
 }
示例#4
0
 private void DisposingSlot(object[] parameters)
 {
     _instance = null;
     TurnOff();
 }
示例#5
0
 private void DisposingSlot(object[] parameters)
 {
     _instance = null;
     TurnOff();
 }
示例#6
0
        void OnDisable()
        // ReSharper restore UnusedMember.Local
        {
#if DEBUG
            if (DebugMode)
                Debug.Log("DesignerOverlay disabled");
#endif
            TurnOff();
            _instance = null;
            SystemManager.Instance.DisposingSignal.Disconnect(DisposingSlot);
        }