/// <summary> /// Renders the currently selected step /// </summary> /// <param name="rStep"></param> private bool DrawActionDetailItem(NodeLinkAction rItem) { bool lIsDirty = false; if (rItem == null) { EditorGUILayout.LabelField("NULL"); return(false); } string lDescription = BaseDescriptionAttribute.GetDescription(rItem.GetType()); if (lDescription.Length > 0) { NodeEditorStyle.DrawInspectorDescription(lDescription, MessageType.None); } // Render out the action specific inspectors bool lIsActionDirty = rItem.OnInspectorGUI(mTarget); if (lIsActionDirty) { lIsDirty = true; } if (lIsDirty) { EditorUtility.SetDirty(rItem); } return(lIsDirty); }
/// <summary> /// Allows us to draw each item in the list /// </summary> /// <param name="rRect"></param> /// <param name="rIndex"></param> /// <param name="rIsActive"></param> /// <param name="rIsFocused"></param> private void DrawActionListItem(Rect rRect, int rIndex, bool rIsActive, bool rIsFocused) { if (rIndex < mTarget.Actions.Count) { NodeLinkAction lItem = mTarget.Actions[rIndex]; if (lItem == null) { EditorGUI.LabelField(rRect, "NULL"); return; } rRect.y += 2; string lName = lItem.Name; if (lName.Length == 0) { lName = BaseNameAttribute.GetName(lItem.GetType()); } Rect lNameRect = new Rect(rRect.x, rRect.y, rRect.width, EditorGUIUtility.singleLineHeight); EditorGUI.LabelField(lNameRect, lName); } }