浏览代码

Updated with new property sheet and row functionality plus added the .css files for them

/main
Martin Thorzen 7 年前
当前提交
a53fbcc2
共有 15 个文件被更改,包括 180 次插入1 次删除
  1. 3
      com.unity.shadergraph/Editor/Resources/Styles/NodeSettings.uss.meta
  2. 3
      com.unity.shadergraph/Editor/Resources/Styles/PBRMaster.uss.meta
  3. 1
      com.unity.shadergraph/Editor/Resources/Styles/PBRSettings.uss
  4. 3
      com.unity.shadergraph/Editor/Resources/Styles/PBRSettings.uss.meta
  5. 3
      com.unity.shadergraph/Editor/Resources/Styles/UnlitSettings.uss.meta
  6. 4
      com.unity.shadergraph/Editor/Resources/UXML/NodeSettings.uxml.meta
  7. 4
      com.unity.shadergraph/Editor/Resources/UXML/PBRMaster.uxml.meta
  8. 42
      com.unity.shadergraph/Editor/Drawing/Views/PropertyRow.cs
  9. 3
      com.unity.shadergraph/Editor/Drawing/Views/PropertyRow.cs.meta
  10. 48
      com.unity.shadergraph/Editor/Drawing/Views/PropertySheet.cs
  11. 3
      com.unity.shadergraph/Editor/Drawing/Views/PropertySheet.cs.meta
  12. 31
      com.unity.shadergraph/Editor/Resources/Styles/PropertyRow.uss
  13. 10
      com.unity.shadergraph/Editor/Resources/Styles/PropertyRow.uss.meta
  14. 13
      com.unity.shadergraph/Editor/Resources/Styles/PropertySheet.uss
  15. 10
      com.unity.shadergraph/Editor/Resources/Styles/PropertySheet.uss.meta

3
com.unity.shadergraph/Editor/Resources/Styles/NodeSettings.uss.meta


fileFormatVersion: 2
guid: 59bba4c88ab5f464d9a8f51088561c48
ScriptedImporter:
fileIDToRecycleName:
11400000: stylesheet
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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


fileFormatVersion: 2
guid: 44d43a48d3bb65e4f846a9aa36118670
ScriptedImporter:
fileIDToRecycleName:
11400000: stylesheet
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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


margin-right: 4;
margin-top: 4;
margin-bottom: 4;
text-color: rgb(193, 193, 193);
}

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


fileFormatVersion: 2
guid: f3ab823364001e34f97c37dc09d9f9a4
ScriptedImporter:
fileIDToRecycleName:
11400000: stylesheet
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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


fileFormatVersion: 2
guid: 9d3e4b37febc07345bbfa4c4ee432c67
ScriptedImporter:
fileIDToRecycleName:
11400000: stylesheet
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

4
com.unity.shadergraph/Editor/Resources/UXML/NodeSettings.uxml.meta


fileFormatVersion: 2
guid: b70651993c98eda43810c32b7416a21b
ScriptedImporter:
fileIDToRecycleName:
11400000: tree
11400002: inlineStyle
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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


fileFormatVersion: 2
guid: 8173c8df1ca473b4b800b9816fdb8669
ScriptedImporter:
fileIDToRecycleName:
11400000: tree
11400002: inlineStyle
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

42
com.unity.shadergraph/Editor/Drawing/Views/PropertyRow.cs


using System.Linq;
using UnityEngine.Experimental.UIElements;
namespace UnityEditor.ShaderGraph.Drawing
{
public class PropertyRow : VisualElement
{
VisualElement m_ContentContainer;
VisualElement m_LabelContainer;
public override VisualElement contentContainer
{
get { return m_ContentContainer; }
}
public VisualElement label
{
get { return m_LabelContainer.FirstOrDefault(); }
set
{
var first = m_LabelContainer.FirstOrDefault();
if (first != null)
first.RemoveFromHierarchy();
m_LabelContainer.Add(value);
}
}
public PropertyRow(VisualElement label = null)
{
AddStyleSheetPath("Styles/PropertyRow");
VisualElement container = new VisualElement {name = "container"};
m_ContentContainer = new VisualElement { name = "content" };
m_LabelContainer = new VisualElement {name = "label" };
m_LabelContainer.Add(label);
container.Add(m_LabelContainer);
container.Add(m_ContentContainer);
shadow.Add(container);
}
}
}

3
com.unity.shadergraph/Editor/Drawing/Views/PropertyRow.cs.meta


fileFormatVersion: 2
guid: 917a1d0b14b14ca0861b93792b550f83
timeCreated: 1521637416

48
com.unity.shadergraph/Editor/Drawing/Views/PropertySheet.cs


using System.Linq;
using UnityEditorInternal;
using UnityEngine.Experimental.UIElements;
namespace UnityEditor.ShaderGraph.Drawing
{
public class PropertySheet : VisualElement
{
VisualElement m_ContentContainer;
VisualElement m_HeaderContainer;
Label m_Header;
public override VisualElement contentContainer
{
get { return m_ContentContainer; }
}
public VisualElement headerContainer
{
get { return m_HeaderContainer.FirstOrDefault(); }
set
{
var first = m_HeaderContainer.FirstOrDefault();
if( first != null )
first.RemoveFromHierarchy();
m_HeaderContainer.Add(value);
}
}
// public Label header
// {
// get { return m_Header; }
// set { m_Header = value; }
// }
public PropertySheet(Label header = null)
{
AddStyleSheetPath("Styles/PropertySheet");
m_ContentContainer = new VisualElement { name = "content" };
m_HeaderContainer = new VisualElement { name = "header" };
if( header != null)
m_HeaderContainer.Add(header);
// header.AddToClassList("header");
m_ContentContainer.Add(m_HeaderContainer);
shadow.Add(m_ContentContainer);
}
}
}

3
com.unity.shadergraph/Editor/Drawing/Views/PropertySheet.cs.meta


fileFormatVersion: 2
guid: 145d8ce4e0814506803af49f799cdb02
timeCreated: 1521645038

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


PropertyRow EnumField,
PropertyRow Label,
PropertyRow Toggle,
PropertyRow DoubleField {
margin-left: 0;
margin-right: 0;
}
PropertyRow > #container{
flex-grow: 1;
padding-left: 8;
padding-right: 8;
flex-direction: row;
}
PropertyRow > #container > #label {
width: 75;
height: 24;
justify-content: center;
}
PropertyRow > #container > #label > Label {
margin-bottom: 3;
}
PropertyRow > #container > #content{
flex-grow: 1;
height: 24;
justify-content: center;
}

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


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

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


PropertySheet {
margin-top: 4;
margin-bottom: 4;
}
PropertySheet > #content > #header{
margin-left: 4;
}
PropertySheet > #content > #header > Label{
text-color: #C1C1C1;
font-size: 11;
font-style: bold;
}

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


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