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

Custom Node can not using UnityEditor #132

Closed AtheosCode closed 7 years ago

AtheosCode commented 7 years ago

Custom Node can not using UnityEditor, Bacause the Node folder is not under the Editor;

public MonoScript mediatorClass;

GUILayout.Label("MediatorName"); mediatorClass = RTEditorGUI.ObjectField<MonoScript>(mediatorClass, true); if (mediatorClass != null) { mediatorName = mediatorClass.GetClass().Name; }

Seneral commented 7 years ago

You can, but you need to wrap it in editor preprocessor checks - see some other nodes for reference. These nodes just have been designed to work at runtime, if you do not want anything to be available at runtime you can put the whole framework in the editor folder. But if you want to access the canvas and it's node at runtime, there's no way around the #if UNITY_EDITOR preprocessor check...