|
|
|
|
|
|
using UnityEditor.Graphing.Drawing; |
|
|
|
using UnityEngine.MaterialGraph; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using RMGUI.GraphView; |
|
|
|
|
|
|
|
namespace UnityEditor.MaterialGraph.Drawing |
|
|
|
{ |
|
|
|
|
|
|
typeMapper[typeof(BlendModeNode)] = typeof(BlendModeNodePresenter); |
|
|
|
typeMapper[typeof(AddManyNode)] = typeof(AddManyNodePresenter); |
|
|
|
typeMapper[typeof(IfNode)] = typeof(IfNodePresenter); |
|
|
|
} |
|
|
|
|
|
|
|
public override List<NodeAnchorPresenter> GetCompatibleAnchors(NodeAnchorPresenter startAnchor, NodeAdapter nodeAdapter) |
|
|
|
{ |
|
|
|
return allChildren.OfType<NodeAnchorPresenter>() |
|
|
|
.Where(nap => nap.IsConnectable() && |
|
|
|
nap.orientation == startAnchor.orientation && |
|
|
|
nap.direction != startAnchor.direction && |
|
|
|
nodeAdapter.GetAdapter(nap.source, startAnchor.source) != null && |
|
|
|
(startAnchor is GraphAnchorPresenter && ((GraphAnchorPresenter)nap).slot is MaterialSlot && |
|
|
|
((MaterialSlot)((GraphAnchorPresenter)startAnchor).slot).IsCompatibleWithInputSlotType(((MaterialSlot)((GraphAnchorPresenter)nap).slot).valueType))) |
|
|
|
.ToList(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |