void ShowOptions() {
			SerializedProperty optionsProperty = currentSubContainerProperty.FindPropertyRelative("options");
		
			if (AddFoldOut(optionsProperty, "Options".ToGUIContent())) {
				currentSubContainer.options[currentSubContainer.options.Length - 1] = PureDataOption.Volume(0);
				containerManagerSerialized.Update();
			}
		
			if (currentSubContainer.options != null && optionsProperty.isExpanded) {
				EditorGUI.indentLevel += 1;
		
				for (int i = 0; i < currentSubContainer.options.Length; i++) {
					currentOption = currentSubContainer.options[i];
					currentOptionProperty = optionsProperty.GetArrayElementAtIndex(i);
		
					BeginBox();
					
					GUIStyle style = new GUIStyle("foldout");
					style.fontStyle = FontStyle.Bold;
					if (DeleteFoldOut(optionsProperty, i, string.Format("{0} | {1}", currentOption.type, currentOption.GetValueDisplayName()).ToGUIContent(), style)) {
						break;
					}
					
					ShowOption();
					EndBox();
				}
		
				Separator();
				EditorGUI.indentLevel -= 1;
			}
		}
Example #2
0
        void ShowOptions()
        {
            SerializedProperty optionsProperty = currentSubContainerProperty.FindPropertyRelative("options");

            if (AddFoldOut(optionsProperty, "Options".ToGUIContent()))
            {
                optionsProperty.GetLastArrayElement().isExpanded = true;
                containerManagerSerialized.ApplyModifiedProperties();
                currentSubContainer.options[currentSubContainer.options.Length - 1].SetDefaultValue();
            }

            if (currentSubContainer.options != null && optionsProperty.isExpanded)
            {
                EditorGUI.indentLevel += 1;

                for (int i = 0; i < currentSubContainer.options.Length; i++)
                {
                    currentOption         = currentSubContainer.options[i];
                    currentOptionProperty = optionsProperty.GetArrayElementAtIndex(i);

                    BeginBox();

                    GUIStyle style = new GUIStyle("foldout");
                    style.fontStyle = FontStyle.Bold;
                    if (DeleteFoldOut(optionsProperty, i, string.Format("{0} | {1}", currentOption.type, currentOption.GetValueDisplayName()).ToGUIContent(), style))
                    {
                        break;
                    }

                    ShowOption();
                    EndBox();
                }

                Separator();
                EditorGUI.indentLevel -= 1;
            }
        }