|
|
|
|
|
|
|
|
|
|
protected List<AbstractNodeInspector> m_Inspectors = new List<AbstractNodeInspector>(); |
|
|
|
|
|
|
|
protected IGraphAsset m_GraphAsset; |
|
|
|
protected IGraphAsset graphAsset |
|
|
|
{ |
|
|
|
get { return target as IGraphAsset; } |
|
|
|
} |
|
|
|
|
|
|
|
protected abstract void AddTypeMappings(Action<Type, Type> map); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void UpdateSelection() |
|
|
|
{ |
|
|
|
if (m_GraphAsset == null) |
|
|
|
if (graphAsset == null) |
|
|
|
selectedNodes.value.AddRange(m_GraphAsset.drawingData.selection.Select(m_GraphAsset.graph.GetNodeFromGuid)); |
|
|
|
selectedNodes.value.AddRange(graphAsset.drawingData.selection.Select(graphAsset.graph.GetNodeFromGuid)); |
|
|
|
if (m_SelectedNodes == null || m_Inspectors.Any(i => i.node == null) || !selectedNodes.value.SequenceEqual(m_SelectedNodes)) |
|
|
|
OnSelectionChanged(selectedNodes.value); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public virtual void OnEnable() |
|
|
|
{ |
|
|
|
m_GraphAsset = target as IGraphAsset; |
|
|
|
m_DataMapper.Clear(); |
|
|
|
AddTypeMappings(m_DataMapper.AddMapping); |
|
|
|
UpdateSelection(); |
|
|
|