您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
38 行
1.2 KiB
38 行
1.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEditor.Experimental.UIElements.GraphView;
|
|
using UnityEngine;
|
|
using UnityEngine.MaterialGraph;
|
|
|
|
namespace UnityEditor.MaterialGraph.Drawing
|
|
{
|
|
public class PropertyControlPresenter : GraphControlPresenter
|
|
{
|
|
public override void OnGUIHandler()
|
|
{
|
|
base.OnGUIHandler();
|
|
|
|
var tNode = node as UnityEngine.MaterialGraph.PropertyNode;
|
|
if (tNode == null)
|
|
return;
|
|
|
|
tNode.exposedState = (PropertyNode.ExposedState)EditorGUILayout.EnumPopup(new GUIContent("Exposed"), tNode.exposedState);
|
|
}
|
|
|
|
public override float GetHeight()
|
|
{
|
|
return (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing) + EditorGUIUtility.standardVerticalSpacing;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public abstract class PropertyNodePresenter : MaterialNodePresenter
|
|
{
|
|
protected override IEnumerable<GraphControlPresenter> GetControlData()
|
|
{
|
|
var instance = CreateInstance<PropertyControlPresenter>();
|
|
instance.Initialize(node);
|
|
return new List<GraphControlPresenter> { instance };
|
|
}
|
|
}
|
|
}
|