浏览代码
Merge pull request #283 from Unity-Technologies/fix-trunk-compatibility
Merge pull request #283 from Unity-Technologies/fix-trunk-compatibility
Fix trunk compatibility/main
GitHub
7 年前
当前提交
dba26376
共有 16 个文件被更改,包括 169 次插入 和 92 次删除
-
37com.unity.shadergraph/Editor/Data/Graphs/SerializableCubemap.cs
-
37com.unity.shadergraph/Editor/Data/Graphs/SerializableMesh.cs
-
38com.unity.shadergraph/Editor/Data/Graphs/SerializableTexture.cs
-
2com.unity.shadergraph/Editor/Drawing/Blackboard/Blackboard.cs
-
2com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardField.cs
-
3com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs
-
2com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardRow.cs
-
2com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardSection.cs
-
2com.unity.shadergraph/Editor/Drawing/MaterialGraphEditWindow.cs
-
46com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs
-
9com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs
-
16com.unity.shadergraph/Editor/Drawing/Views/ShaderPort.cs
-
33com.unity.shadergraph/Editor/Util/CompatibilityExtensions.cs
-
3com.unity.shadergraph/Editor/Util/CompatibilityExtensions.cs.meta
-
12com.unity.shadergraph/Editor/Util/GraphTypeMapper.cs.meta
-
17com.unity.shadergraph/Editor/Util/GraphTypeMapper.cs
|
|||
using System; |
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.UIElements; |
|||
|
|||
#if UNITY_2018_1
|
|||
using UnityEditor.Experimental.UIElements.GraphView; |
|||
#endif
|
|||
|
|||
namespace UnityEditor.ShaderGraph.Drawing |
|||
{ |
|||
static class CompatibilityExtensions |
|||
{ |
|||
#if UNITY_2018_1
|
|||
public static void OpenTextEditor(this BlackboardField field) |
|||
{ |
|||
field.RenameGo(); |
|||
} |
|||
#endif
|
|||
|
|||
public static void AppendAction(this ContextualMenu contextualMenu, string actionName, Action action, Func<ContextualMenu.MenuAction.StatusFlags> actionStatusCallback) |
|||
{ |
|||
Debug.Assert(action != null); |
|||
Debug.Assert(actionStatusCallback != null); |
|||
contextualMenu.AppendAction(actionName, e => action(), e => actionStatusCallback()); |
|||
} |
|||
|
|||
public static void AppendAction(this ContextualMenu contextualMenu, string actionName, Action action, ContextualMenu.MenuAction.StatusFlags statusFlags) |
|||
{ |
|||
Debug.Assert(action != null); |
|||
contextualMenu.AppendAction(actionName, e => action(), e => statusFlags); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 7c1717b624ad45ccbb3fa6bec28af711 |
|||
timeCreated: 1519741123 |
|
|||
fileFormatVersion: 2 |
|||
guid: efaba3c359b73408c9888998f9a4c87d |
|||
timeCreated: 1482407708 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using UnityEditor.Experimental.UIElements.GraphView; |
|||
|
|||
namespace UnityEditor.Graphing.Util |
|||
{ |
|||
public class GraphTypeMapper : BaseTypeFactory<INode, GraphElement> |
|||
{ |
|||
public GraphTypeMapper(Type fallbackType) : base(fallbackType) |
|||
{ |
|||
} |
|||
|
|||
protected override GraphElement InternalCreate(Type valueType) |
|||
{ |
|||
return (GraphElement)Activator.CreateInstance(valueType); |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue