浏览代码

Add undo actions for blackboard

/main
Peter Bay Bastian 7 年前
当前提交
84072c18
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Blackboard/BlackboardField.cs
  2. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Blackboard/BlackboardProvider.cs

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Blackboard/BlackboardField.cs


activeFieldInfo.SetValue(m_SelectionDropper, false);
this.AddManipulator(m_SelectionDropper);
var contextualMenuManipulator = (IManipulator)Activator.CreateInstance(s_ContextualMenuManipulator, (Action<ContextualMenuPopulateEvent>)BuildContextualMenu);
this.AddManipulator(contextualMenuManipulator);
this.AddManipulator((IManipulator)Activator.CreateInstance(s_ContextualMenuManipulator, (Action<ContextualMenuPopulateEvent>)BuildContextualMenu));
}
void BuildContextualMenu(ContextualMenuPopulateEvent evt)

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Blackboard/BlackboardProvider.cs


var property = visualElement.userData as IShaderProperty;
if (property == null)
return;
m_Graph.owner.RegisterCompleteObjectUndo("Move Property");
m_Graph.MoveShaderProperty(property, newIndex);
}

var property = (IShaderProperty)field.userData;
if (newText != property.displayName)
{
m_Graph.owner.RegisterCompleteObjectUndo("Edit Property Name");
property.displayName = newText;
field.text = newText;
DirtyNodes();

{
field.RenameGo();
row.expanded = true;
m_Graph.owner.RegisterCompleteObjectUndo("Create Property");
m_Graph.AddShaderProperty(property);
}
}

正在加载...
取消
保存