浏览代码

Add Blackboard support for Boolean

/main
Matt Dean 7 年前
当前提交
5d0155ff
共有 2 个文件被更改,包括 12 次插入0 次删除
  1. 11
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Blackboard/BlackboardFieldPropertyView.cs
  2. 1
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Blackboard/BlackboardProvider.cs

11
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Blackboard/BlackboardFieldPropertyView.cs


});
AddRow("Default", field);
}
else if (property is BooleanShaderProperty)
{
var booleanProperty = (BooleanShaderProperty)property;
Action onBooleanChanged = () =>
{
booleanProperty.value = !booleanProperty.value;
DirtyNodes();
};
var field = new Toggle(onBooleanChanged) { on = booleanProperty.value };
AddRow("Default", field);
}
// AddRow("Type", new TextField());
// AddRow("Exposed", new Toggle(null));
// AddRow("Range", new Toggle(null));

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


gm.AddItem(new GUIContent("Color"), false, () => AddProperty(new ColorShaderProperty(), true));
gm.AddItem(new GUIContent("Texture"), false, () => AddProperty(new TextureShaderProperty(), true));
gm.AddItem(new GUIContent("Cubemap"), false, () => AddProperty(new CubemapShaderProperty(), true));
gm.AddItem(new GUIContent("Boolean"), false, () => AddProperty(new BooleanShaderProperty(), true));
gm.ShowAsContext();
}

正在加载...
取消
保存