private void InspectEntity(SEntityId entityId) { CEngine engine = CEngine.Instance; engine.Dispatch(EEngineUpdatePriority.BeginFrame, () => { CUpdateScheduler scheduler = engine.CurrentWorld.UpdateScheduler; if (m_updateScope != null && m_updateScope.IsConnected()) { scheduler.Disconnect(m_updateScope); } CEntity entity = entityId.GetEntity(); if (entity != null) { m_selectedObject = new CEditableObject(entityId); m_updateScope = scheduler.Connect(UpdateCallback, EUpdatePriority.ResourceLoading); Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)(() => { m_desiredTarget = new CEditableObject(entityId); UnmarkEverything(); MarkEntityInInspector(true); })); } }); }
private void InspectComponent(SEntityComponentId componentId) { bool bUpdateInspectorObjectList = ShouldUpdateInspectorList(componentId); CEngine engine = CEngine.Instance; CWorldOutlinerViewModel worldOutliner = CWorkspace.Instance.GetTool <CWorldOutlinerViewModel>(); engine.Dispatch(EEngineUpdatePriority.BeginFrame, () => { CUpdateScheduler scheduler = engine.CurrentWorld.UpdateScheduler; if (m_updateScope != null && m_updateScope.IsConnected()) { scheduler.Disconnect(m_updateScope); } CEntityComponent component = componentId.GetComponent(); if (component != null) { m_selectedObject = new CEditableObject(componentId); m_updateScope = scheduler.Connect(UpdateCallback, EUpdatePriority.ResourceLoading); if (bUpdateInspectorObjectList) { UpdateEntityInformation_EngineThread(new SEntityId(component.Owner.Id)); } worldOutliner.PickingComponentId.GetComponent <CScenePickingComponent>().Pick(component as CSceneComponent); Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)(() => { m_desiredTarget = new CEditableObject(componentId); UnmarkEverything(); MarkComponentInInspector(componentId, true); })); } else { Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)(() => { m_desiredTarget = null; UnmarkEverything(); })); } }); }