Closed AtheosCode closed 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...
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; }