コード例 #1
0
            public DebugEntityHierarchyEditorViewModel([NotNull] IViewModelServiceProvider serviceProvider, [NotNull] EntityHierarchyEditorViewModel editor)
                : base(serviceProvider)
            {
                this.editor = editor;
                var sceneLoader = editor.Controller.Loader;

                // We use reflection to access private fields and protected properties.
                var propertyInfo = typeof(EditorContentLoader).GetProperty("AssetLoadingTimeUrls", BindingFlags.Instance | BindingFlags.NonPublic);

                if (propertyInfo == null)
                {
                    throw new MissingFieldException("EditorContentLoader misses the 'AssetLoadingTimeUrls' protected member.");
                }
                assetLoadingTimeUrls = (Dictionary <AssetId, string>)propertyInfo.GetValue(sceneLoader);

                propertyInfo = typeof(EditorContentLoader).GetProperty("Game", BindingFlags.Instance | BindingFlags.NonPublic);
                if (propertyInfo == null)
                {
                    throw new MissingFieldException("EditorContentLoader misses the 'Game' protected member.");
                }
                game = (EditorServiceGame)propertyInfo.GetValue(sceneLoader);

                LoadingTimeUrls = new ObservableList <string>();
                LoadedAssets    = new ObservableList <string>();
                RefreshCommand  = new AnonymousCommand(ServiceProvider, Refresh);
            }
コード例 #2
0
        private void OnLoaded([NotNull] EntityHierarchyEditorViewModel editor)
        {
            var items = editor.HierarchyRoot.Children.Where(Filter)
                        .Select(x => new EntityHierarchyItemViewModelWrapper(x, Filter, ComponentType)).Where(x => x.MatchesCriteria);

            SceneContent.Clear();
            SceneContent.AddRange(items);
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EditorGameEntitySelectionService"/> class.
 /// </summary>
 /// <param name="editor">The <see cref="EntityHierarchyEditorViewModel"/> related to the current instance of the scene editor.</param>
 public EditorGameEntitySelectionService([NotNull] EntityHierarchyEditorViewModel editor)
 {
     if (editor == null)
     {
         throw new ArgumentNullException(nameof(editor));
     }
     Editor = editor;
 }
コード例 #4
0
ファイル: StrideDialogService.cs プロジェクト: vvvv/stride
        /// <inheritdoc/>
        public IEntityPickerDialog CreateEntityPickerDialog(EntityHierarchyEditorViewModel editor)
        {
            if (editor == null)
            {
                throw new ArgumentNullException(nameof(editor));
            }
            var picker = new EntityPickerWindow(editor, null);

            return(picker);
        }
コード例 #5
0
 public EditorGameEntityTransformService([NotNull] EntityHierarchyEditorViewModel editor, [NotNull] IEditorGameController controller)
 {
     if (editor == null)
     {
         throw new ArgumentNullException(nameof(editor));
     }
     if (controller == null)
     {
         throw new ArgumentNullException(nameof(controller));
     }
     this.editor     = editor;
     this.controller = controller;
 }
コード例 #6
0
ファイル: StrideDialogService.cs プロジェクト: vvvv/stride
        /// <inheritdoc/>
        public IEntityPickerDialog CreateEntityComponentPickerDialog(EntityHierarchyEditorViewModel editor, Type componentType)
        {
            if (editor == null)
            {
                throw new ArgumentNullException(nameof(editor));
            }
            if (!typeof(EntityComponent).IsAssignableFrom(componentType))
            {
                throw new ArgumentException(@"The given component type does not inherit from EntityComponent.", nameof(componentType));
            }

            var picker = new EntityPickerWindow(editor, componentType);

            return(picker);
        }
コード例 #7
0
        public EntityPickerWindow([NotNull] EntityHierarchyEditorViewModel editor, Type targetType)
        {
            if (editor == null)
            {
                throw new ArgumentNullException(nameof(editor));
            }

            InitializeComponent();
            if (targetType != null && typeof(EntityComponent).IsAssignableFrom(targetType))
            {
                ComponentType = targetType;
                Width        *= 2;
            }
            DataContext = this;
            Loaded     += (s, e) => OnLoaded(editor);
        }
コード例 #8
0
 public EditorGameLightProbeGizmoService(EntityHierarchyEditorViewModel editor)
 {
     this.editor = editor;
 }
コード例 #9
0
 public EditorGameNavigationMeshService(EntityHierarchyEditorViewModel editor)
 {
     this.editor           = editor;
     navigationMeshManager = new NavigationMeshManager(editor.Controller);
 }
コード例 #10
0
 public EditorGameMaterialHighlightService(EntityHierarchyEditorViewModel editor)
 {
     this.editor = editor;
 }
コード例 #11
0
 public EditorGameEntityCameraService([NotNull] EntityHierarchyEditorViewModel editor, IEditorGameController controller)
     : base(controller)
 {
     this.editor = editor;
 }
コード例 #12
0
 public EditorGameModelSelectionService(EntityHierarchyEditorViewModel editor)
 {
     this.editor = editor;
 }
コード例 #13
0
 public EditorGameCubemapService(EntityHierarchyEditorViewModel editor)
 {
     this.editor = editor;
 }
コード例 #14
0
 public DebugEntityHierarchyEditorUserControl([NotNull] EntityHierarchyEditorViewModel editor)
 {
     DataContext = new DebugEntityHierarchyEditorViewModel(editor.ServiceProvider, editor);
     Title       = $"Scene '{((IAssetEditorViewModel)editor).Asset.Url}'";
     InitializeComponent();
 }
コード例 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityHierarchyEditorController"/> class.
 /// </summary>
 /// <param name="asset">The scene associated with this instance.</param>
 /// <param name="editor">The editor associated with this instance.</param>
 /// <param name="gameFactory">The factory to create the editor game.</param>
 protected EntityHierarchyEditorController([NotNull] AssetViewModel asset, [NotNull] EntityHierarchyEditorViewModel editor, [NotNull] EditorGameFactory <EntityHierarchyEditorGame> gameFactory)
     : base(asset, editor, gameFactory)
 {
 }