|
1 | 1 | using System;
|
2 | 2 | using System.Collections.Generic;
|
3 | 3 | using UnityEditor.UIElements;
|
| 4 | +using UnityEditorInternal; |
4 | 5 | using UnityEngine;
|
5 | 6 | using UnityEngine.Rendering.RenderGraphModule;
|
6 | 7 | using UnityEngine.UIElements;
|
@@ -343,12 +344,22 @@ void CreateTextElement(VisualElement parent, string text, string className = nul
|
343 | 344 |
|
344 | 345 | attachmentFoldout.Add(new TextElement
|
345 | 346 | {
|
346 |
| - text = $"<b>Load action:</b> {attachmentInfo.loadAction} ({attachmentInfo.loadReason})" |
| 347 | + text = $"<b>Load action:</b> {attachmentInfo.loadAction}\n- {attachmentInfo.loadReason}" |
347 | 348 | });
|
348 |
| - attachmentFoldout.Add(new TextElement |
| 349 | + |
| 350 | + bool addMsaaInfo = !string.IsNullOrEmpty(attachmentInfo.storeMsaaReason); |
| 351 | + string resolvedTexturePrefix = addMsaaInfo ? "Resolved surface: " : ""; |
| 352 | + |
| 353 | + string storeActionText = $"<b>Store action:</b> {attachmentInfo.storeAction}" + |
| 354 | + $"\n - {resolvedTexturePrefix}{attachmentInfo.storeReason}"; |
| 355 | + |
| 356 | + if (addMsaaInfo) |
349 | 357 | {
|
350 |
| - text = $"<b>Store action:</b> {attachmentInfo.storeAction} ({attachmentInfo.storeReason})" |
351 |
| - }); |
| 358 | + string msaaTexturePrefix = "MSAA surface: "; |
| 359 | + storeActionText += $"\n - {msaaTexturePrefix}{attachmentInfo.storeMsaaReason}"; |
| 360 | + } |
| 361 | + |
| 362 | + attachmentFoldout.Add(new TextElement { text = storeActionText }); |
352 | 363 |
|
353 | 364 | passItem.Add(attachmentFoldout);
|
354 | 365 | }
|
@@ -427,12 +438,26 @@ void ScrollToFoldout(VisualElement parent, int index)
|
427 | 438 | ScrollView scrollView = parent.Q<ScrollView>();
|
428 | 439 | scrollView.Query<Foldout>(classes: Classes.kPanelListItem).ForEach(foldout =>
|
429 | 440 | {
|
430 |
| - if (index == (int)foldout.userData) |
| 441 | + if (index == (int) foldout.userData) |
431 | 442 | {
|
432 | 443 | // Trigger animation
|
433 | 444 | foldout.AddToClassList(Classes.kPanelListItemSelectionAnimation);
|
| 445 | + |
| 446 | + // This repaint hack is needed because transition animations have poor framerate. So we are hooking to editor update |
| 447 | + // loop for the duration of the animation to force repaints and have a smooth highlight animation. |
| 448 | + // See https://jira.unity3d.com/browse/UIE-1326 |
| 449 | + EditorApplication.update += Repaint; |
| 450 | + |
434 | 451 | foldout.RegisterCallbackOnce<TransitionEndEvent>(_ =>
|
435 |
| - foldout.RemoveFromClassList(Classes.kPanelListItemSelectionAnimation)); |
| 452 | + { |
| 453 | + // "Highlight in" animation finished |
| 454 | + foldout.RemoveFromClassList(Classes.kPanelListItemSelectionAnimation); |
| 455 | + foldout.RegisterCallbackOnce<TransitionEndEvent>(_ => |
| 456 | + { |
| 457 | + // "Highlight out" animation finished |
| 458 | + EditorApplication.update -= Repaint; |
| 459 | + }); |
| 460 | + }); |
436 | 461 |
|
437 | 462 | // Open foldout
|
438 | 463 | foldout.value = true;
|
|
0 commit comments