public override void OnInspectorGUI() { //base.OnInspectorGUI(); GUIUtils.StartCustomEditor(); EditorGUI.indentLevel++; GUIUtils.StartBox(); GUIUtils.DrawProp(so["gizmoColor"], new GUIContent("Gizmo Color")); GUIUtils.Space(); GUIUtils.DrawProp(so["behavior"], new GUIContent("Cue Behavior")); EditorProp repeats = so["repeats"]; GUIUtils.DrawProp(repeats, new GUIContent("Repeats", "How Many times this cue repeats")); if (repeats.intValue < 1) { repeats.SetValue(1); } if (HasSubCues()) { GUIUtils.DrawToggleProp(so["useRandomPlaylist"], new GUIContent("Use Random Sub-Cue", "Plays one sub-cue at random, not all sequentially")); } GUIUtils.EndBox(); EditorGUI.indentLevel--; GUIUtils.EndCustomEditor(so); }
bool DrawPackParameter(EditorProp parameter) { //name bool nameChanged = GUIUtils.DrawTextProp(parameter[nameField], GUIUtils.TextFieldType.Normal, false, "param name", GUILayout.MinWidth(32)); //type GUILayoutOption pFieldWidth = GUILayout.Width(100); GUIUtils.DrawEnumProp( parameter[CustomParameterEditor.typeField], (int i) => (CustomParameter.ParamType)i, (Enum s) => (int)((CustomParameter.ParamType)s), pFieldWidth ); //value GUIUtils.DrawProp(CustomParameterEditor.GetParamValueProperty(parameter), GUILayout.Width(128)); return(nameChanged); }
void DrawAOParameters(bool drawingSingle, EditorProp ao) { for (int i = 0; i < parameterLabels.Length; i++) { EditorGUILayout.BeginHorizontal(); //multi set button GUI.enabled = !drawingSingle; if (GUIUtils.SmallButton(multiSetValueGUI)) { multiSetParameterIndex = i; } GUI.enabled = true; GUIUtils.Label(parameterLabels[i], parameterLabelWidth); GUIUtils.DrawProp(CustomParameterEditor.GetParamValueProperty(ao[AOStateMachineEditor.paramsField][i])); EditorGUILayout.EndHorizontal(); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); bool isSmoothSnap = so[snapStyleField].enumValueIndex == (int)Cue.SnapPlayerStyle.Smooth; GUIUtils.StartCustomEditor(); GUIUtils.StartBox(0); EditorGUILayout.BeginHorizontal(); GUIUtils.Label(msgBlocksLabel); if (GUIUtils.SmallButton(new GUIContent("", "Paste"), Colors.green, Colors.black)) { for (int i = 0; i < 4; i++) { so[messageBlocksField][i].SetValue(copiedMessages[i]); } } if (GUIUtils.SmallButton(new GUIContent("", "Copy"), Colors.yellow, Colors.black)) { for (int i = 0; i < 4; i++) { copiedMessages[i] = so[messageBlocksField][i].stringValue; } } if (GUIUtils.SmallDeleteButton()) { for (int i = 0; i < 4; i++) { so[messageBlocksField][i].SetValue(""); } } EditorGUILayout.EndHorizontal(); GUIUtils.Tabs((isSmoothSnap ? 4 : 3).Generate(i => tabLbls[i]).ToArray(), ref currentMsgBlock); GUIUtils.DrawMultiLineExpandableString(so[messageBlocksField][currentMsgBlock], false, "mesage block", 50); GUIUtils.EndBox(1); GUIUtils.StartBox(1); EditorGUI.indentLevel++; GUIUtils.DrawEnumProp( so[snapStyleField], snapStyleGUI, (int i) => (Cue.SnapPlayerStyle)i, (System.Enum s) => (int)((Cue.SnapPlayerStyle)s) ); if (isSmoothSnap) { EditorGUI.indentLevel++; GUIUtils.DrawProp(so[smoothPosTimeField], positionTimeGUI); GUIUtils.DrawProp(so[smoothRotTimeField], rotationTimeGUI); GUIUtils.DrawToggleProp(so[playImmediateField], playImmediateGUI); EditorGUI.indentLevel--; } GUIUtils.DrawProp(so[positionOffsetField], positionOffsetGUI); GUIUtils.DrawProp(so[rotationOffsetField], rotationOffsetGUI); GUIUtils.EndBox(1); GUIUtils.Space(); EditorGUI.indentLevel--; GUIUtils.Label(new GUIContent("<b>The following variables wont be used if the cue has sub-cues:</b>")); EditorGUI.indentLevel++; GUIUtils.StartBox(1); GUIUtils.DrawProp(so[overrideDurationField], overrideDurationGUI); EditorGUI.indentLevel--; GUIUtils.Space(); GUIUtils.DrawObjArrayProp <Event>(so[eventsField]); GUIUtils.EndBox(1); GUIUtils.EndCustomEditor(so); }