浏览代码

Transform node in master graph presenter

Fixed power slider
/main
Andre McGrail 8 年前
当前提交
48e29dbb
共有 2 个文件被更改,包括 5 次插入12 次删除
  1. 1
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/MaterialGraphPresenter.cs
  2. 16
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/Vector1NodePresenter.cs

1
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/MaterialGraphPresenter.cs


typeMapper[typeof(Matrix2Node)] = typeof(Matrix2NodePresenter);
typeMapper[typeof(Matrix3Node)] = typeof(Matrix3NodePresenter);
typeMapper[typeof(Matrix4Node)] = typeof(Matrix4NodePresenter);
typeMapper[typeof(TransformNode)] = typeof(TransformNodePresenter);
}
}
}

16
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/Vector1NodePresenter.cs


{
class Vector1ControlPresenter : GraphControlPresenter
{
[SerializeField]
private int dynamicHeight;
public override void OnGUIHandler()
{

tNode.floatType = (FloatPropertyChunk.FloatType)EditorGUILayout.EnumPopup ("Float", tNode.floatType);
dynamicHeight = 8;
dynamicHeight = 16;
tNode.floatType = FloatPropertyChunk.FloatType.Range;
tNode.value = EditorGUILayout.Slider (tNode.value, tNode.rangeValues.x, tNode.rangeValues.y);
EditorGUILayout.BeginHorizontal ();

tNode.rangeValues = ranges;
break;
case FloatPropertyChunk.FloatType.PowerSlider:
dynamicHeight = 16;
//very dirty...
for (int i = 0; i < 15; i++) {
EditorGUILayout.Space ();
}
//power needs to be name
ranges.z = EditorGUILayout.FloatField (ranges.z);
ranges.z = EditorGUILayout.FloatField ("Power", ranges.z);
dynamicHeight = 8;
bool toggleState = tNode.value == 0f ? false : true;
tNode.floatType = FloatPropertyChunk.FloatType.Toggle;
toggleState = EditorGUILayout.Toggle (toggleState);

public override float GetHeight()
{
return (EditorGUIUtility.singleLineHeight + dynamicHeight * EditorGUIUtility.standardVerticalSpacing) + EditorGUIUtility.standardVerticalSpacing;
return (EditorGUIUtility.singleLineHeight + 16 * EditorGUIUtility.standardVerticalSpacing) + EditorGUIUtility.standardVerticalSpacing;
}
}

正在加载...
取消
保存