EditorContentManager Part 1

This commit is contained in:
Simon Lübeß
2023-01-01 16:53:45 +01:00
parent dffd43a36f
commit c389a77274
29 changed files with 3774 additions and 81 deletions
@@ -268,7 +268,7 @@ namespace GlitchyEditor.EditWindows
StringView path = .((char8*)payload.Data, (int)payload.DataSize);
Texture2D texture = new Texture2D(path, true);
Texture2D texture = Content.LoadAsset<Texture2D>(path);//new Texture2D(path, true);
spriteRendererComponent.Sprite?.ReleaseRef();
spriteRendererComponent.Sprite = texture;
@@ -319,7 +319,7 @@ namespace GlitchyEditor.EditWindows
StringView path = .((char8*)payload.Data, (int)payload.DataSize);
using (Texture2D newTexture = new Texture2D(path, true))
using (Texture2D newTexture = Content.LoadAsset<Texture2D>(path))//new Texture2D(path, true))
{
newTexture.SamplerState = SamplerStateManager.AnisotropicWrap;
material.SetTexture(texture.key, newTexture);
@@ -16,16 +16,16 @@ namespace GlitchyEditor.EditWindows
const String ContentDirectory = "./content";
//private String _currentDirectory ~ delete _;
private TreeNode<EditorContentManager.AssetNode> _currentDirectoryNode;
private TreeNode<AssetNode> _currentDirectoryNode;
public static SubTexture2D s_FolderTexture;
public static SubTexture2D s_FileTexture;
public EditorContentManager _manager ~ delete _;
public EditorContentManager _manager;
public this()
public this(EditorContentManager contentManager)
{
_manager = new EditorContentManager();
_manager = contentManager;
}
protected override void InternalShow()