浏览代码
Remove usage of EditorGUILayout.MiniThumbnailObjectField, so that we don't have to make it public
/main
Remove usage of EditorGUILayout.MiniThumbnailObjectField, so that we don't have to make it public
/main
Peter Bay Bastian
7 年前
当前提交
a00f148d
共有 9 个文件被更改,包括 78 次插入 和 122 次删除
-
2MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/SubGraph/SubGraphNode.cs
-
25MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Controls/ObjectControl.cs
-
79MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/ShaderPropertyView.cs
-
8MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/MaterialGraph.uss
-
2MaterialGraphProject/ProjectSettings/ProjectVersion.txt
-
3MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/IMGUISlotEditorView.cs.meta
-
72MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/IMGUISlotEditorView.cs
-
9MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/NodeInspectors.meta
|
|||
m_EditorVersion: 2018.1.0a3 |
|||
m_EditorVersion: 2018.1.0a4 |
|
|||
fileFormatVersion: 2 |
|||
guid: 1c0c3a78bde740fba369b4d5a58d5354 |
|||
timeCreated: 1503663627 |
|
|||
using UnityEngine.Experimental.UIElements; |
|||
using UnityEditor.Graphing; |
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.ShaderGraph.Drawing.Inspector |
|||
{ |
|||
public class IMGUISlotEditorView : VisualElement |
|||
{ |
|||
MaterialSlot m_Slot; |
|||
int m_SlotsHash; |
|||
|
|||
public IMGUISlotEditorView(MaterialSlot slot) |
|||
{ |
|||
m_Slot = slot; |
|||
Add(new IMGUIContainer(OnGUIHandler)); |
|||
} |
|||
|
|||
void OnGUIHandler() |
|||
{ |
|||
if (m_Slot == null) |
|||
return; |
|||
var previousWideMode = EditorGUIUtility.wideMode; |
|||
EditorGUIUtility.wideMode = true; |
|||
var modified = SlotField(m_Slot); |
|||
EditorGUIUtility.wideMode = previousWideMode; |
|||
|
|||
if (modified) |
|||
m_Slot.owner.onModified(m_Slot.owner, ModificationScope.Node); |
|||
} |
|||
|
|||
public static bool SlotField(MaterialSlot slot) |
|||
{ |
|||
EditorGUI.BeginChangeCheck(); |
|||
if (slot is DynamicVectorMaterialSlot) |
|||
{ |
|||
var dynSlot = slot as DynamicVectorMaterialSlot; |
|||
dynSlot.value = EditorGUILayout.Vector4Field(slot.displayName, dynSlot.value); |
|||
} |
|||
|
|||
if (slot is Vector1MaterialSlot) |
|||
{ |
|||
var dynSlot = slot as Vector1MaterialSlot; |
|||
dynSlot.value = EditorGUILayout.FloatField(slot.displayName, dynSlot.value); |
|||
} |
|||
|
|||
if (slot is Vector2MaterialSlot) |
|||
{ |
|||
var dynSlot = slot as Vector2MaterialSlot; |
|||
dynSlot.value = EditorGUILayout.Vector2Field(slot.displayName, dynSlot.value); |
|||
} |
|||
|
|||
if (slot is Vector3MaterialSlot) |
|||
{ |
|||
var dynSlot = slot as Vector3MaterialSlot; |
|||
dynSlot.value = EditorGUILayout.Vector3Field(slot.displayName, dynSlot.value); |
|||
} |
|||
|
|||
if (slot is Vector4MaterialSlot) |
|||
{ |
|||
var dynSlot = slot as Vector4MaterialSlot; |
|||
dynSlot.value = EditorGUILayout.Vector4Field(slot.displayName, dynSlot.value); |
|||
} |
|||
|
|||
if (slot is Texture2DInputMaterialSlot) |
|||
{ |
|||
//var dynslot = slot as Texture2DInputMaterialSlot;
|
|||
//dynslot.texture = EditorGUILayout.MiniThumbnailObjectField(new GUIContent("Texture"), dynslot.texture, typeof(Texture), null) as Texture;
|
|||
} |
|||
return EditorGUI.EndChangeCheck(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: eb549fa7bbf654674b93a8ea187f48ea |
|||
folderAsset: yes |
|||
timeCreated: 1482418252 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue