Seneral / Node_Editor_Framework

A flexible and modular Node Editor Framework for creating node based displays and editors in Unity
https://nodeeditor.seneral.dev
MIT License
2.01k stars 414 forks source link

Additional overloads for Node.CreateInput with System.Type parameter instead of string #135

Closed kpietraszko closed 7 years ago

kpietraszko commented 7 years ago

Currently Node.CreateInput look like this: public NodeInput CreateInput (string inputName, string inputType) Could we get an overload that takes: string inputName and System.Type inputType? Same for Node.CreateOutput.

Seneral commented 7 years ago

Oh, sure, I forgot them... They were build-in before the restructure:) Try to make a commit this evening. Seneral

kpietraszko commented 7 years ago

@Seneral Thanks. I'm a bit puzzled why types are stored in Dictionary<string, TypeData>, instead of Dictionary<Type, TypeData>

Seneral commented 7 years ago

Because it stores connection types (or ConnectionStyles after the restructure) that do not necessarily define a value connection but might just be for visual purposes and thus use an string identifier. With the type functions you can simply reference them by the type, too, of course. But lot's of people requested being able to style a connection without the (for them) useless typing and value handling, so it has been separated:)

kpietraszko commented 7 years ago

Oh ok. I guess that makes it more versatile. With System.Type overloads everyone will be happy 👍

Seneral commented 7 years ago

Just noticed, which version are you using? Definitely not the latest develop branch, which I was assuming...

Seneral commented 7 years ago

Adding it to the latest develop branch for now, will not update master for that though. What you can do though is use typeof(Type).FullName instead, for both creation and adressing. Of course you can add these as wrappers yourself:) This will, if that ConnectionType is not defined somewhere, create a type automatically by itself:) Seneral

kpietraszko commented 7 years ago

@Seneral I'm using master branch. I guess I will switch to develop branch. Thanks for your engagement in this project.

Seneral commented 7 years ago

Sure, think that's better. Although, lot's of changes, and lot's of manual adjustments of existing nodes needed since I reworked major systems recently... But definitely worth it:) Seneral

Seneral commented 7 years ago

Implemented in 5962974:)