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(); } }
void OnDisable() // ReSharper restore UnusedMember.Local { #if DEBUG if (DebugMode) { Debug.Log("DesignerOverlay disabled"); } #endif TurnOff(); _instance = null; SystemManager.Instance.DisposingSignal.Disconnect(DisposingSlot); }
/// <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 }
private void DisposingSlot(object[] parameters) { _instance = null; TurnOff(); }
void OnDisable() // ReSharper restore UnusedMember.Local { #if DEBUG if (DebugMode) Debug.Log("DesignerOverlay disabled"); #endif TurnOff(); _instance = null; SystemManager.Instance.DisposingSignal.Disconnect(DisposingSlot); }