Fix discarding unsaved asset editor changes

- clear cached JsonAsset managed instances on discard,
- restore MaterialInstance parameter values and override flags,
- reload model assets from disk when model edits are discarded.
This commit is contained in:
Andrei Gagua
2026-05-30 23:54:52 +03:00
parent 6daec81db1
commit 3ba1f5192f
5 changed files with 57 additions and 6 deletions
+10
View File
@@ -93,5 +93,15 @@ namespace FlaxEngine
string str = instance != null ? JsonSerializer.Serialize(instance) : null;
Data = str;
}
#if FLAX_EDITOR
/// <summary>
/// Clears the cached managed instance. The next <see cref="Instance"/> access will recreate it from the asset data.
/// </summary>
public void ClearInstance()
{
_instance = null;
}
#endif
}
}