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
2k stars 415 forks source link

Error: Random.InitState(seed) is not allowed in ScripatableObject's Contructor #163

Closed No3371 closed 5 years ago

No3371 commented 6 years ago

This happens when I try to use a ValueConnectionKnobStyle with Type parameter on dynamicConnectionPort. (I have not tested it on static ports)

private ValueConnectionKnobAttribute optionconditionAttr 
    = new ValueConnectionKnobAttribute("Show?", Direction.In, typeof(bool), ConnectionCount.Single, NodeSide.Left);

And if I try to use "Bool" parameter the result knob texture would be totally white. (Failed to create the style)

Seneral commented 6 years ago

Hm will have to take a closer look later, but never seen this before. It's only for color generation for new types that do not have a style definition somewhere in the project though... Should be some workaround. If you want to get going quickly, I recommend to just create style definitions with predefined colors for each style! For that, take reference from the default float connection type.