public static void DataBindingField(GUIContent label, DataBinding bind, UnityEngine.Object bindOwner, bool isForSetter, Type[] limitTypes = null) { DataProviderEd.LoadDefinedProviders(); int selectedIndex = (!((UnityEngine.Object)bind.dataprovider == (UnityEngine.Object)null)) ? (isForSetter ? DataProviderEd.setterProviders.IndexOf(bind.dataprovider) : DataProviderEd.getterProviders.IndexOf(bind.dataprovider)) : 0; EditorGUILayout.BeginHorizontal(); if ((UnityEngine.Object)bind.dataprovider != (UnityEngine.Object)null && string.IsNullOrEmpty(bind.dataprovider.ident)) { if (label == null) { if (GUILayout.Button(DataProviderEd.GetDataBindingLabel(bind.dataprovider), plyEdGUI.Styles.MiniButtonLeft)) { DataBindingWindow.Show_DataBindingWindow(bind, bindOwner, isForSetter, limitTypes); } } else if (plyEdGUI.LabelButton(label, DataProviderEd.GetDataBindingLabel(bind.dataprovider), plyEdGUI.Styles.MiniButtonLeft)) { DataBindingWindow.Show_DataBindingWindow(bind, bindOwner, isForSetter, limitTypes); } } else { EditorGUI.BeginChangeCheck(); selectedIndex = ((label != null) ? EditorGUILayout.Popup(label, selectedIndex, isForSetter ? DataProviderEd.setterProviderLabels : DataProviderEd.getterProviderLabels, plyEdGUI.Styles.MiniButtonLeft) : EditorGUILayout.Popup(selectedIndex, isForSetter ? DataProviderEd.setterProviderLabels : DataProviderEd.getterProviderLabels, plyEdGUI.Styles.MiniButtonLeft)); if (EditorGUI.EndChangeCheck()) { bind.dataprovider = (isForSetter ? DataProviderEd.setterProviders[selectedIndex] : DataProviderEd.getterProviders[selectedIndex]); } } if (GUILayout.Button(DataProviderEd.GC_EdButton, plyEdGUI.Styles.MiniButtonRight, GUILayout.Width(25f))) { DataBindingWindow.Show_DataBindingWindow(bind, bindOwner, isForSetter, limitTypes); } EditorGUILayout.EndHorizontal(); }
protected override void Draw(Rect rect, DataProvider target, bool isSetter) { CurveDataMapProvider curveDataMapProvider = target as CurveDataMapProvider; CurveDataMapProviderEd.GC_Label.text = DataProviderEd.GetDataBindingLabel(curveDataMapProvider.param1.dataprovider); rect.height = EditorGUIUtility.singleLineHeight; DataProviderEd.DataBindingField(rect, CurveDataMapProviderEd.GC_Param1, curveDataMapProvider.param1, curveDataMapProvider, false, null); rect.y += (float)(EditorGUIUtility.singleLineHeight + 2.0); curveDataMapProvider.curve = EditorGUI.CurveField(rect, CurveDataMapProviderEd.GC_Curve, curveDataMapProvider.curve); rect.y += (float)(EditorGUIUtility.singleLineHeight + 2.0); curveDataMapProvider.roundingOpt = (RoundingOption)EditorGUI.EnumPopup(rect, CurveDataMapProviderEd.GC_Rounding, (Enum)(object)curveDataMapProvider.roundingOpt); }
protected override void Draw(Rect rect, DataProvider target, bool isSetter) { GraphMappedValuesProvider graphMappedValuesProvider = target as GraphMappedValuesProvider; GraphMappedValuesProviderEd.GC_Label.text = DataProviderEd.GetDataBindingLabel(graphMappedValuesProvider.param1.dataprovider); rect.height = EditorGUIUtility.singleLineHeight; DataProviderEd.DataBindingField(rect, GraphMappedValuesProviderEd.GC_Param1, graphMappedValuesProvider.param1, graphMappedValuesProvider, false, null); rect.y += (float)(EditorGUIUtility.singleLineHeight + 2.0); graphMappedValuesProvider.yIsInput = EditorGUI.Toggle(rect, GraphMappedValuesProviderEd.GC_InputY, graphMappedValuesProvider.yIsInput); rect.y += (float)(EditorGUIUtility.singleLineHeight + 2.0); graphMappedValuesProvider.curve = plyEdGUI.GraphMappedValuesField(rect, GraphMappedValuesProviderEd.GC_Curve, graphMappedValuesProvider.curve); }