Skip to content

[Enhance] Prioritize node created from assets#222

Open
Looooong wants to merge 1 commit into
alelievr:masterfrom
Looooong:enhance/prioritize-node-created-from-assets
Open

[Enhance] Prioritize node created from assets#222
Looooong wants to merge 1 commit into
alelievr:masterfrom
Looooong:enhance/prioritize-node-created-from-assets

Conversation

@Looooong

Copy link
Copy Markdown

For example, when drag&dropping asset into a graph, the node that implements ICreateNodeFrom<CustomRenderTexture> should be prioritized over the node that implements ICreateNodeFrom<Texture>, because CustomRenderTexture is the subclass of Texture.

BaseGraphView.nodeTypePerCreateAssetType is changed from Dictionary to SortedDictionary to support this behaviour.

@Looooong
Looooong force-pushed the enhance/prioritize-node-created-from-assets branch from 76cd680 to 8f8b1f1 Compare September 26, 2022 16:45
dyonng added a commit to dyonng/NodeGraphProcessor that referenced this pull request Jul 24, 2026
- Make BaseGraphView.CanConnectEdge virtual (upstream alelievr#232), so
  subclasses can override edge-connection validation without forking.
- Change nodeTypePerCreateAssetType to a SortedDictionary with a
  subclass-priority comparer (upstream alelievr#222), so dragging an asset
  whose type has multiple matching ICreateNodeFrom<T> implementations
  picks the most derived one instead of an arbitrary insertion-order
  match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant