public override void OnInspectorGUI() { //show TypeGUI TypeGUI(); //Show default value when not in play, else show currnet value SerializedProperty _property = (EditorApplication.isPlaying) ? m_currentValue : m_defaultValue; if (_property != null) { _property.isExpanded = true; //force property to be expanded (e.g. Quaternions) EditorGUI.BeginChangeCheck(); //display and apply property EditorGUILayout.PropertyField(_property, new GUIContent(_property.propertyType.ToString()), true); serializedObject.ApplyModifiedProperties(); serializedObject.UpdateIfRequiredOrScript(); if (EditorGUI.EndChangeCheck()) { EditorVariableUtility.InvokeVariableEvent(target); } } EditorGUILayout.Space(); }
private static void OnAcceptableRelease(string guid, Rect selectionRect, string hoverPath, string[] draggedPaths) { if (draggedPaths.All(p => p == hoverPath)) { foreach (Variable var in DraggedVariables) { EditorVariableUtility.DeattachAsset(var); } } else { foreach (Variable variable in DraggedVariables) { EditorVariableUtility.AttachAssetTo(variable, hoverPath); } } }