Ejemplo n.º 1
0
        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>());
                });
            }
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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();
                    }));
                }
            });
        }
Ejemplo n.º 4
0
        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);
                });
            }
        }