|
|
|
|
|
|
using System.Linq; |
|
|
|
using UnityEditor.Experimental.UIElements.GraphView; |
|
|
|
using UnityEditor.Graphing.Drawing; |
|
|
|
using UnityEditor.Graphing.Util; |
|
|
|
using UnityEngine.Graphing; |
|
|
|
using UnityEngine.MaterialGraph; |
|
|
|
using UnityEngine; |
|
|
|
|
|
|
{ |
|
|
|
data.OnModified(ModificationScope.Node); |
|
|
|
UpdatePreviewTexture(m_currentPreviewData); |
|
|
|
Dirty(ChangeType.Repaint); |
|
|
|
} |
|
|
|
ListPool<INode>.Release(childrenNodes); |
|
|
|
} |
|
|
|
|
|
|
m_PreviewImage.RemoveFromClassList("inactive"); |
|
|
|
m_PreviewImage.image = texture; |
|
|
|
} |
|
|
|
Dirty(ChangeType.Repaint); |
|
|
|
} |
|
|
|
|
|
|
|
void UpdateControls(MaterialNodePresenter nodeData) |
|
|
|
|
|
|
m_ControlsContainer.ClearChildren(); |
|
|
|
if (controlPresenters.ItemsReferenceEquals(m_CurrentControlPresenter) && nodeData.expanded) |
|
|
|
return; |
|
|
|
|
|
|
|
m_ControlsContainer.Clear(); |
|
|
|
m_CurrentControlPresenter.Clear(); |
|
|
|
|
|
|
|
if (!nodeData.expanded) |
|
|
|
|
|
|
{ |
|
|
|
m_ControlsContainer.AddChild(CreateControl(controlData)); |
|
|
|
m_ControlsContainer.Add(CreateControl(controlData)); |
|
|
|
m_CurrentControlPresenter.Add(controlData); |
|
|
|
} |
|
|
|
} |
|
|
|