private void OnActiveWindowChanged(RuntimeWindow window) { UnsubscribeFromEvents(); if (m_rte.ActiveWindow != null && m_rte.ActiveWindow.WindowType == RuntimeWindowType.Scene) { m_selectionComponent = m_rte.ActiveWindow.IOCContainer.Resolve <IRuntimeSelectionComponent>(); m_boxSelection = m_rte.ActiveWindow.IOCContainer.Resolve <IBoxSelection>(); } else { m_selectionComponent = null; m_boxSelection = null; } SubscribeToEvents(); }
private void Start() { SetCanSelect(Mode == ProBuilderToolMode.Object); if (m_rte.ActiveWindow != null && m_rte.ActiveWindow.WindowType == RuntimeWindowType.Scene) { m_selectionComponent = m_rte.ActiveWindow.IOCContainer.Resolve <IRuntimeSelectionComponent>(); m_boxSelection = m_rte.ActiveWindow.IOCContainer.Resolve <IBoxSelection>(); SubscribeToEvents(); } if (m_rte != null) { m_rte.ActiveWindowChanged += OnActiveWindowChanged; m_rte.Tools.PivotModeChanging += OnPivotModeChanging; m_rte.Tools.PivotModeChanged += OnPivotModeChanged; m_rte.Tools.PivotRotationChanging += OnPivotRotationChanging; m_rte.Tools.PivotRotationChanged += OnPivotRotationChanged; m_rte.SceneLoading += OnSceneLoading; } }