()
| 385 | |
| 386 | /// <inheritdoc /> |
| 387 | public override void Save() |
| 388 | { |
| 389 | // Check if don't need to push any new changes to the original asset |
| 390 | if (!IsEdited) |
| 391 | return; |
| 392 | |
| 393 | try |
| 394 | { |
| 395 | Editor.Scene.OnSaveStart(_viewport._uiParentLink); |
| 396 | |
| 397 | // Simply update changes |
| 398 | Editor.Prefabs.ApplyAll(_viewport.Instance); |
| 399 | |
| 400 | // Refresh properties panel to sync new prefab default values |
| 401 | _propertiesEditor.BuildLayout(); |
| 402 | } |
| 403 | catch (Exception) |
| 404 | { |
| 405 | // Disable live reload on error |
| 406 | if (LiveReload) |
| 407 | { |
| 408 | LiveReload = false; |
| 409 | } |
| 410 | |
| 411 | throw; |
| 412 | } |
| 413 | finally |
| 414 | { |
| 415 | Editor.Scene.OnSaveEnd(_viewport._uiParentLink); |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | /// <inheritdoc /> |
| 420 | protected override void UpdateToolstrip() |
nothing calls this directly
no test coverage detected