Add content deprecation system that auto-saves assets in Editor that use old data format
This commit is contained in:
@@ -154,18 +154,8 @@ void GameplayGlobals::ResetValues()
|
||||
|
||||
bool GameplayGlobals::Save(const StringView& path)
|
||||
{
|
||||
// Validate state
|
||||
if (WaitForLoaded())
|
||||
{
|
||||
LOG(Error, "Asset loading failed. Cannot save it.");
|
||||
if (OnCheckSave(path))
|
||||
return true;
|
||||
}
|
||||
if (IsVirtual() && path.IsEmpty())
|
||||
{
|
||||
LOG(Error, "To save virtual asset asset you need to specify the target asset path location.");
|
||||
return true;
|
||||
}
|
||||
|
||||
ScopeLock lock(Locker);
|
||||
|
||||
// Save to bytes
|
||||
|
||||
@@ -80,20 +80,12 @@ public:
|
||||
/// </summary>
|
||||
API_FUNCTION() void ResetValues();
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
/// <summary>
|
||||
/// Saves this asset to the file. Supported only in Editor.
|
||||
/// </summary>
|
||||
/// <param name="path">The custom asset path to use for the saving. Use empty value to save this asset to its own storage location. Can be used to duplicate asset. Must be specified when saving virtual asset.</param>
|
||||
/// <returns>True if cannot save data, otherwise false.</returns>
|
||||
API_FUNCTION() bool Save(const StringView& path = StringView::Empty);
|
||||
|
||||
#endif
|
||||
|
||||
public:
|
||||
// [BinaryAsset]
|
||||
void InitAsVirtual() override;
|
||||
#if USE_EDITOR
|
||||
bool Save(const StringView& path = StringView::Empty) override;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// [BinaryAsset]
|
||||
|
||||
Reference in New Issue
Block a user