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); }
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); }
/// <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; }
/// <inheritdoc/> public IEntityPickerDialog CreateEntityPickerDialog(EntityHierarchyEditorViewModel editor) { if (editor == null) { throw new ArgumentNullException(nameof(editor)); } var picker = new EntityPickerWindow(editor, null); return(picker); }
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; }
/// <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); }
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); }
public EditorGameLightProbeGizmoService(EntityHierarchyEditorViewModel editor) { this.editor = editor; }
public EditorGameNavigationMeshService(EntityHierarchyEditorViewModel editor) { this.editor = editor; navigationMeshManager = new NavigationMeshManager(editor.Controller); }
public EditorGameMaterialHighlightService(EntityHierarchyEditorViewModel editor) { this.editor = editor; }
public EditorGameEntityCameraService([NotNull] EntityHierarchyEditorViewModel editor, IEditorGameController controller) : base(controller) { this.editor = editor; }
public EditorGameModelSelectionService(EntityHierarchyEditorViewModel editor) { this.editor = editor; }
public EditorGameCubemapService(EntityHierarchyEditorViewModel editor) { this.editor = editor; }
public DebugEntityHierarchyEditorUserControl([NotNull] EntityHierarchyEditorViewModel editor) { DataContext = new DebugEntityHierarchyEditorViewModel(editor.ServiceProvider, editor); Title = $"Scene '{((IAssetEditorViewModel)editor).Asset.Url}'"; InitializeComponent(); }
/// <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) { }