浏览代码

Make the modified property names bold through uss

/main
Jens Holm 7 年前
当前提交
2f658454
共有 3 个文件被更改,包括 18 次插入4 次删除
  1. 9
      com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldPropertyView.cs
  2. 3
      com.unity.shadergraph/Editor/Resources/Styles/PropertyNameReferenceField.uss
  3. 10
      com.unity.shadergraph/Editor/Resources/Styles/PropertyNameReferenceField.uss.meta

9
com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldPropertyView.cs


m_Property = property;
m_ReferenceNameField = new TextField(512, false, false, ' ');
m_ReferenceNameField.AddStyleSheetPath("Styles/PropertyNameReferenceField");
AddRow("Reference", m_ReferenceNameField);
m_ReferenceNameField.value = property.referenceName;
m_ReferenceNameField.isDelayed = true;

m_ReferenceNameField.value = property.referenceName;
if (string.IsNullOrEmpty(property.overrideReferenceName))
m_ReferenceNameField.style.fontStyle = StyleValue<FontStyle>.Create(FontStyle.Normal);
m_ReferenceNameField.RemoveFromClassList("modified");
m_ReferenceNameField.style.fontStyle = StyleValue<FontStyle>.Create(FontStyle.Bold);
m_ReferenceNameField.AddToClassList("modified");
DirtyNodes(ModificationScope.Graph);
UpdateReferenceNameResetMenu();

m_ReferenceNameField.style.fontStyle = StyleValue<FontStyle>.Create(FontStyle.Bold);
m_ReferenceNameField.AddToClassList("modified");
if (property is Vector1ShaderProperty)
{

{
m_Property.overrideReferenceName = null;
m_ReferenceNameField.value = m_Property.referenceName;
m_ReferenceNameField.style.fontStyle = StyleValue<FontStyle>.Create(FontStyle.Normal);
m_ReferenceNameField.RemoveFromClassList("modified");
DirtyNodes(ModificationScope.Graph);
}, ContextualMenu.MenuAction.AlwaysEnabled);
}

3
com.unity.shadergraph/Editor/Resources/Styles/PropertyNameReferenceField.uss


TextField.modified {
font-style: bold;
}

10
com.unity.shadergraph/Editor/Resources/Styles/PropertyNameReferenceField.uss.meta


fileFormatVersion: 2
guid: 93842094f0dbac941bac7d2af67241b3
ScriptedImporter:
fileIDToRecycleName:
11400000: stylesheet
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
正在加载...
取消
保存