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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user