void Awake() { editData = new CameraNodeEditorData(); editData.selectedNode = target as CameraNode; CameraNodeToolbar.editData = editData; toolbar = new CameraNodeToolbar(); }
void OnEnable() { list = new ReorderableList(serializedObject, serializedObject.FindProperty("connectedNodes"), true, true, true, true); list.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => { var element = list.serializedProperty.GetArrayElementAtIndex(index); rect.y += 2; EditorGUI.ObjectField( new Rect(rect.x, rect.y, rect.width - 30, EditorGUIUtility.singleLineHeight), element, GUIContent.none); }; if (toolbar == null) { toolbar = new CameraNodeToolbar(); } editData = new CameraNodeEditorData(); editData.selectedNode = target as CameraNode; CameraNodeToolbar.editData = editData; SceneView.onSceneGUIDelegate += toolbar.OnSceneGUI; }