-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
607 additions
and
565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#nullable enable | ||
|
||
using DirectX12GameEngine.Editor.Messages; | ||
using DirectX12GameEngine.Editor.Messaging; | ||
|
||
namespace DirectX12GameEngine.Editor.ViewModels | ||
{ | ||
public class MainViewModel : ViewModelBase | ||
{ | ||
private StorageItemViewModel? rootFolder; | ||
|
||
public MainViewModel() | ||
{ | ||
RegisterMessages(); | ||
} | ||
|
||
public EditorViewsViewModel EditorViews { get; } = new EditorViewsViewModel(); | ||
|
||
public ProjectLoaderViewModel ProjectLoader { get; } = new ProjectLoaderViewModel(); | ||
|
||
public StorageItemViewModel? RootFolder | ||
{ | ||
get => rootFolder; | ||
set => Set(ref rootFolder, value); | ||
} | ||
|
||
private void RegisterMessages() | ||
{ | ||
Messenger.Default.Register<ProjectLoadedMessage>(this, async m => | ||
{ | ||
RootFolder = m.RootFolder; | ||
RootFolder.HasUnrealizedChildren = true; | ||
await RootFolder.FillAsync(); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Threading.Tasks; | ||
using DirectX12GameEngine.Engine; | ||
|
||
#nullable enable | ||
|
||
namespace DirectX12GameEngine.Editor.ViewModels | ||
{ | ||
public class SceneViewModel : ViewModelBase | ||
{ | ||
private readonly EditorGame game; | ||
|
||
public SceneViewModel(EditorGame game) | ||
{ | ||
this.game = game; | ||
|
||
game.SceneSystem.SceneInstance.RootEntity = RootEntity.Model; | ||
} | ||
|
||
public EntityViewModel RootEntity { get; } = new EntityViewModel(new Entity("RootEntity")); | ||
|
||
public async Task LoadAsync(string path) | ||
{ | ||
RootEntity.Children.Clear(); | ||
|
||
Entity scene = await game.Content.LoadAsync<Entity>(path); | ||
EntityViewModel sceneViewModel = new EntityViewModel(scene); | ||
|
||
RootEntity.Children.Add(sceneViewModel); | ||
} | ||
} | ||
} |
Oops, something went wrong.