public static void PickComponent(SEntityComponentId id) { CWorldOutlinerViewModel worldOutliner = CWorkspace.Instance.GetTool <CWorldOutlinerViewModel>(); if (worldOutliner != null) { CEngine.Instance.Dispatch(EEngineUpdatePriority.BeginFrame, () => { worldOutliner.PickingComponentId.GetComponent <CScenePickingComponent>()?.Pick(id.GetComponent <CSceneComponent>()); }); } }
private void InternalRenameEntity(object argument) { string name = argument as string; EntityInfo[0].Name = name; CWorldOutlinerViewModel vm = CWorkspace.Instance.GetTool <CWorldOutlinerViewModel>(); vm.SelectedEntityViewModel.Name = name; EntityName = name; }
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(); })); } }); }
public static void PickRootComponent(SEntityId entityId) { CWorldOutlinerViewModel worldOutliner = CWorkspace.Instance.GetTool <CWorldOutlinerViewModel>(); if (worldOutliner != null) { CEntity entity = entityId.GetEntity(); if (entity == null) { return; } CEngine.Instance.Dispatch(EEngineUpdatePriority.BeginFrame, () => { worldOutliner.PickingComponentId.GetComponent <CScenePickingComponent>()?.Pick(entity.RootComponent); }); } }