-
Notifications
You must be signed in to change notification settings - Fork 868
Expand file tree
/
Copy pathConverterItemState.cs
More file actions
39 lines (36 loc) · 1.08 KB
/
ConverterItemState.cs
File metadata and controls
39 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using UnityEngine.UIElements;
namespace UnityEditor.Rendering.Converter
{
// This is the serialized class that stores the state of each item in the list of items to convert
[Serializable]
class ConverterItemState
{
public Action<bool> onIsSelectedChanged;
private bool m_IsSelected;
public bool isSelected
{
get => m_IsSelected;
set
{
if (m_IsSelected != value)
{
m_IsSelected = value;
onIsSelectedChanged?.Invoke(m_IsSelected);
}
}
}
public IRenderPipelineConverterItem item;
[NonSerialized]
public (Status Status, string Message) conversionResult = (Status.Pending, string.Empty);
internal bool hasConverted => conversionResult.Status != Status.Pending;
public void OnSelectionChanged(ClickEvent _)
{
isSelected = !isSelected;
}
public void OnClicked(ClickEvent _)
{
item.OnClicked();
}
}
}