| 11 | public static class EditorAssets |
| 12 | { |
| 13 | internal class Cache |
| 14 | { |
| 15 | private static MaterialInstance _highlightMaterial; |
| 16 | |
| 17 | /// <summary> |
| 18 | /// Gets the highlight material instance. |
| 19 | /// </summary> |
| 20 | public static MaterialInstance HighlightMaterialInstance |
| 21 | { |
| 22 | get |
| 23 | { |
| 24 | if (!_highlightMaterial) |
| 25 | { |
| 26 | var material = FlaxEngine.Content.LoadAsyncInternal<MaterialBase>(HighlightMaterial); |
| 27 | if (material && !material.WaitForLoaded()) |
| 28 | { |
| 29 | _highlightMaterial = material.CreateVirtualInstance(); |
| 30 | OnEditorOptionsChanged(Editor.Instance.Options.Options); |
| 31 | } |
| 32 | } |
| 33 | return _highlightMaterial; |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | public static void OnEditorOptionsChanged(Options.EditorOptions options) |
| 38 | { |
| 39 | if (!_highlightMaterial) |
| 40 | return; |
| 41 | var param = _highlightMaterial.GetParameter("Color"); |
| 42 | if (param != null) |
| 43 | param.Value = options.Visual.HighlightColor; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | /// <summary> |
| 48 | /// The icons atlas. |
nothing calls this directly
no test coverage detected