浏览代码

Fixed the PR feedback I got.

/main
Martin Thorzen 7 年前
当前提交
e34a3053
共有 14 个文件被更改,包括 14 次插入141 次删除
  1. 3
      com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs
  2. 14
      com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs
  3. 3
      com.unity.shadergraph/Editor/Drawing/Views/PBRSettingsView.cs
  4. 3
      com.unity.shadergraph/Editor/Drawing/Views/UnlitSettingsView.cs
  5. 2
      com.unity.shadergraph/Editor/Resources/Styles/PropertyRow.uss
  6. 10
      com.unity.shadergraph/Editor/Resources/Styles/PropertySheet.uss
  7. 21
      com.unity.shadergraph/Editor/Resources/Styles/PBRMaster.uss
  8. 10
      com.unity.shadergraph/Editor/Resources/Styles/PBRMaster.uss.meta
  9. 10
      com.unity.shadergraph/Editor/Resources/Styles/PBRSettings.uss.meta
  10. 10
      com.unity.shadergraph/Editor/Resources/Styles/UnlitSettings.uss.meta
  11. 27
      com.unity.shadergraph/Editor/Resources/Styles/PBRSettings.uss
  12. 25
      com.unity.shadergraph/Editor/Resources/Styles/UnlitSettings.uss
  13. 6
      com.unity.shadergraph/Editor/Resources/UXML/PBRMaster.uxml
  14. 11
      com.unity.shadergraph/Editor/Resources/UXML/PBRMaster.uxml.meta

3
com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs


{
public sealed class MaterialGraphView : GraphView, IDropTarget
{
NodeSettingsView m_NodeSettingsView;
public MaterialGraphView()
{
AddStyleSheetPath("Styles/MaterialGraphView");

public MaterialGraphView(AbstractMaterialGraph graph) : this()
{
this.graph = graph;
MaterialGraph mg = (MaterialGraph)graph;
var node = mg.masterNode;
}
public AbstractMaterialGraph graph { get; private set; }

14
com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs


VisualElement m_SettingsContainer;
bool m_ShowSettings = false;
VisualElement m_SettingsButton;
VisualElement m_SettingsDivider;
// Remove this after updated to the correct API call has landed in trunk. ------------
VisualElement m_TitleContainer;
VisualElement m_ButtonContainer;
// -----------------------------------------------------------------------------------
public void Initialize(AbstractMaterialNode inNode, PreviewManager previewManager, IEdgeConnectorListener connectorListener)
{

m_CollapseButton = this.Q("collapse-button");
// Remove this after updated to the correct API call has landed in trunk. ------------
VisualElement m_TitleContainer;
VisualElement m_ButtonContainer;
m_TitleContainer = this.Q("title");
// -----------------------------------------------------------------------------------

m_SettingsButton = new VisualElement {name = "settings-button"};
m_SettingsButton.Add(new VisualElement { name = "icon" });
m_Settings = settings.CreateSettingsElement();
UpdateSettingsExpandedState(settings);
UpdateSettingsExpandedState();
}));
// Remove this after updated to the correct API call has landed in trunk. ------------

}
}
void UpdateSettingsExpandedState(IHasSettings settings)
void UpdateSettingsExpandedState()
m_Settings = settings.CreateSettingsElement();
m_NodeSettingsView.Add(m_Settings);
m_NodeSettingsView.visible = true;

3
com.unity.shadergraph/Editor/Drawing/Views/PBRSettingsView.cs


PBRMasterNode m_Node;
public PBRSettingsView(PBRMasterNode node)
{
AddStyleSheetPath("Styles/PBRSettings");
m_Node = (PBRMasterNode)node;
m_Node = node;
PropertySheet ps = new PropertySheet();

3
com.unity.shadergraph/Editor/Drawing/Views/UnlitSettingsView.cs


UnlitMasterNode m_Node;
public UnlitSettingsView(UnlitMasterNode node)
{
AddStyleSheetPath("Styles/UnlitSettings");
m_Node = (UnlitMasterNode)node;
m_Node = node;
PropertySheet ps = new PropertySheet();

2
com.unity.shadergraph/Editor/Resources/Styles/PropertyRow.uss


PropertyRow Toggle,
PropertyRow DoubleField {
margin-left: 0;
margin-right: 0;
margin-right: 0;
}
PropertyRow > #container{

10
com.unity.shadergraph/Editor/Resources/Styles/PropertySheet.uss


PropertySheet {
margin-top: 4;
margin-top: 4;
margin-left: 4;
margin-left: 4;
text-color: #C1C1C1;
font-size: 11;
font-style: bold;
text-color: #C1C1C1;
font-size: 11;
font-style: bold;
}

21
com.unity.shadergraph/Editor/Resources/Styles/PBRMaster.uss


NodeSettingsView > #mainContainer > #title {
font-style: bold;
font-color: rgb(0, 177, 200);
background-color: #F0F0F0;
width: 200;
}
NodeSettingsView > #mainContainer > .row {
flex-direction: row;
}
NodeSettingsView > #mainContainer > .indented {
padding-left: 8;
}
NodeSettingsView > #mainContainer > .row > .rowLabel{
padding-left: 8;
width: 200;
font-color: rgb(200,0,200);
background-color: #F0F0F0;
}

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


fileFormatVersion: 2
guid: 44d43a48d3bb65e4f846a9aa36118670
ScriptedImporter:
fileIDToRecycleName:
11400000: stylesheet
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}

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


fileFormatVersion: 2
guid: f3ab823364001e34f97c37dc09d9f9a4
ScriptedImporter:
fileIDToRecycleName:
11400000: stylesheet
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}

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


fileFormatVersion: 2
guid: 9d3e4b37febc07345bbfa4c4ee432c67
ScriptedImporter:
fileIDToRecycleName:
11400000: stylesheet
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}

27
com.unity.shadergraph/Editor/Resources/Styles/PBRSettings.uss


PBRSettingsView{
}
PBRSettingsView > #container{
flex-grow: 1;
padding-top: 4;
padding-left: 4;
padding-right: 4;
padding-bottom: 4;
}
PBRSettingsView > #container > .row {
flex-direction: row;
}
PBRSettingsView > #container > .row > .label {
width: 75;
}
PBRSettingsView > #container > .row > .enumcontainer{
flex-grow: 1;
margin-left: 4;
margin-right: 4;
margin-top: 4;
margin-bottom: 4;
}

25
com.unity.shadergraph/Editor/Resources/Styles/UnlitSettings.uss


UnlitSettingsView > #container{
flex-grow: 1;
padding-top: 4;
padding-left: 4;
padding-right: 4;
padding-bottom: 4;
}
UnlitSettingsView > #container > .row {
flex-direction: row;
}
UnlitSettingsView > #container > .row > .label {
width: 75;
}
UnlitSettingsView > #container > .row > .enumcontainer{
flex-grow: 1;
margin-left: 4;
margin-right: 4;
margin-top: 4;
margin-bottom: 4;
text-color: rgb(193, 193, 193);
}

6
com.unity.shadergraph/Editor/Resources/UXML/PBRMaster.uxml


<UXML xmlns:ui="UnityEngine.Experimental.UIElements">
<ui:VisualElement name="container" class="row">
<Style path="Styles/NodeSettings"/>
<ui:Label name="nodename" text="Settings"/>
</ui:VisualElement>
</UXML>

11
com.unity.shadergraph/Editor/Resources/UXML/PBRMaster.uxml.meta


fileFormatVersion: 2
guid: 8173c8df1ca473b4b800b9816fdb8669
ScriptedImporter:
fileIDToRecycleName:
11400000: tree
11400002: inlineStyle
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
正在加载...
取消
保存