Beispiel #1
0
        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);
                    }));
                }
            });
        }
Beispiel #2
0
        public override void PostWorldLoad()
        {
            base.PostWorldLoad();

            m_world = CEngine.Instance.CurrentWorld;

            CEngine engine = CEngine.Instance;

            engine.Dispatch(EEngineUpdatePriority.BeginFrame, () =>
            {
                CEntity entity = m_world.SpawnEntity <CEntity>();
                entity.AddComponent <CSceneComponent>(true, true);
                m_world.DestroyEntity(entity);
            });

            m_hostControl.SetWorld(m_world);
        }
Beispiel #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();
                    }));
                }
            });
        }