Add content deprecation system that auto-saves assets in Editor that use old data format

This commit is contained in:
Wojtek Figat
2025-01-20 23:46:49 +01:00
parent 1497acef58
commit 8a7ceef288
67 changed files with 751 additions and 427 deletions

View File

@@ -13,6 +13,7 @@ class MaterialShader;
API_CLASS(NoSpawn) class FLAXENGINE_API Material : public ShaderAssetTypeBase<MaterialBase>
{
DECLARE_BINARY_ASSET_HEADER(Material, ShadersSerializedVersion);
private:
MaterialShader* _materialShader = nullptr;
@@ -25,7 +26,6 @@ public:
API_FUNCTION() BytesContainer LoadSurface(bool createDefaultIfMissing);
#if USE_EDITOR
/// <summary>
/// Updates the material surface (save new one, discard cached data, reload asset).
/// </summary>
@@ -33,7 +33,6 @@ public:
/// <param name="info">The material info structure.</param>
/// <returns>True if cannot save it, otherwise false.</returns>
API_FUNCTION() bool SaveSurface(const BytesContainer& data, const MaterialInfo& info);
#endif
public:
@@ -52,6 +51,7 @@ public:
// [ShaderAssetBase]
#if USE_EDITOR
void InitCompilationOptions(ShaderCompilationOptions& options) override;
bool Save(const StringView& path = StringView::Empty) override;
#endif
protected: