Example #1
0
 private void Audio3DGUI()
 {
     EditorGUILayout.Slider(this.m_DopplerLevel, 0f, 5f, AudioSourceInspector.ms_Styles.dopplerLevelLabel, new GUILayoutOption[0]);
     EditorGUI.BeginChangeCheck();
     AudioSourceInspector.AnimProp(AudioSourceInspector.ms_Styles.spreadLabel, this.m_AudioCurves[2].curveProp, 0f, 360f, true);
     if (this.m_RolloffMode.hasMultipleDifferentValues || (this.m_RolloffMode.enumValueIndex == 2 && this.m_AudioCurves[0].curveProp.hasMultipleDifferentValues))
     {
         SerializedProperty arg_C5_0 = this.m_AudioCurves[0].curveProp;
         GUIContent         arg_C5_1 = AudioSourceInspector.ms_Styles.rolloffLabel;
         if (AudioSourceInspector.< > f__mg$cache0 == null)
         {
             AudioSourceInspector.< > f__mg$cache0 = new TargetChoiceHandler.TargetChoiceMenuFunction(AudioSourceInspector.SetRolloffToTarget);
         }
         EditorGUILayout.TargetChoiceField(arg_C5_0, arg_C5_1, AudioSourceInspector.< > f__mg$cache0, new GUILayoutOption[0]);
Example #2
0
        internal static void AddSetToValueOfTargetMenuItems(GenericMenu menu, SerializedProperty property, TargetChoiceHandler.TargetChoiceMenuFunction func)
        {
            SerializedProperty property2 = property.serializedObject.FindProperty(property.propertyPath);

            UnityEngine.Object[] targetObjects = property.serializedObject.targetObjects;
            List <string>        list          = new List <string>();

            UnityEngine.Object[] array = targetObjects;
            for (int i = 0; i < array.Length; i++)
            {
                UnityEngine.Object @object = array[i];
                string             text    = string.Format("Set to Value of {0}", @object.name);
                if (list.Contains(text))
                {
                    int num = 1;
                    while (true)
                    {
                        text = string.Format("Set to Value of {0}({1})", @object.name, num);
                        if (!list.Contains(text))
                        {
                            break;
                        }
                        num++;
                    }
                }
                list.Add(text);
                GUIContent arg_CF_1 = EditorGUIUtility.TextContent(text);
                bool       arg_CF_2 = false;
                if (TargetChoiceHandler.< > f__mg$cache0 == null)
                {
                    TargetChoiceHandler.< > f__mg$cache0 = new GenericMenu.MenuFunction2(TargetChoiceHandler.TargetChoiceForwardFunction);
                }
                menu.AddItem(arg_CF_1, arg_CF_2, TargetChoiceHandler.< > f__mg$cache0, new PropertyAndTargetHandler(property2, @object, func));
            }
        }
        internal static void AddSetToValueOfTargetMenuItems(GenericMenu menu, SerializedProperty property, TargetChoiceHandler.TargetChoiceMenuFunction func)
        {
            SerializedProperty property2 = property.serializedObject.FindProperty(property.propertyPath);

            UnityEngine.Object[] targetObjects = property.serializedObject.targetObjects;
            List <string>        list          = new List <string>();

            UnityEngine.Object[] array = targetObjects;
            for (int i = 0; i < array.Length; i++)
            {
                UnityEngine.Object @object = array[i];
                string             text    = "Set to Value of " + @object.name;
                if (list.Contains(text))
                {
                    int num = 1;
                    while (true)
                    {
                        text = string.Concat(new object[]
                        {
                            "Set to Value of ",
                            @object.name,
                            " (",
                            num,
                            ")"
                        });
                        if (!list.Contains(text))
                        {
                            break;
                        }
                        num++;
                    }
                }
                list.Add(text);
                menu.AddItem(EditorGUIUtility.TextContent(text), false, new GenericMenu.MenuFunction2(TargetChoiceHandler.TargetChoiceForwardFunction), new PropertyAndTargetHandler(property2, @object, func));
            }
        }
        internal static void AddSetToValueOfTargetMenuItems(GenericMenu menu, SerializedProperty property, TargetChoiceHandler.TargetChoiceMenuFunction func)
        {
            SerializedProperty property1 = property.serializedObject.FindProperty(property.propertyPath);

            Object[]      targetObjects = property.serializedObject.targetObjects;
            List <string> stringList    = new List <string>();

            foreach (Object target in targetObjects)
            {
                string textAndTooltip = "Set to Value of " + target.name;
                if (stringList.Contains(textAndTooltip))
                {
                    int num = 1;
                    while (true)
                    {
                        textAndTooltip = "Set to Value of " + target.name + " (" + (object)num + ")";
                        if (stringList.Contains(textAndTooltip))
                        {
                            ++num;
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                stringList.Add(textAndTooltip);
                menu.AddItem(EditorGUIUtility.TextContent(textAndTooltip), false, new GenericMenu.MenuFunction2(TargetChoiceHandler.TargetChoiceForwardFunction), (object)new PropertyAndTargetHandler(property1, target, func));
            }
        }
 public PropertyAndTargetHandler(SerializedProperty property, Object target, TargetChoiceHandler.TargetChoiceMenuFunction function)
 {
     this.property = property;
     this.target   = target;
     this.function = function;
 }
Example #6
0
        internal static void TargetChoiceField(SerializedProperty property, GUIContent label, TargetChoiceHandler.TargetChoiceMenuFunction func, params GUILayoutOption[] options)
        {
            Rect rect = GUILayoutUtility.GetRect(EditorGUIUtility.fieldWidth, EditorGUILayout.kLabelFloatMaxW, EditorGUI.kSingleLineHeight, EditorGUI.kSingleLineHeight, EditorStyles.popup, options);

            EditorGUI.TargetChoiceField(rect, property, label, func);
        }
Example #7
0
 internal static void TargetChoiceField(Rect position, SerializedProperty property, GUIContent label, TargetChoiceHandler.TargetChoiceMenuFunction func)
 {
     EditorGUI.BeginProperty(position, label, property);
     position = EditorGUI.PrefixLabel(position, 0, label);
     EditorGUI.BeginHandleMixedValueContentColor();
     if (GUI.Button(position, EditorGUI.mixedValueContent, EditorStyles.popup))
     {
         GenericMenu menu = new GenericMenu();
         TargetChoiceHandler.AddSetToValueOfTargetMenuItems(menu, property, func);
         menu.DropDown(position);
     }
     EditorGUI.EndHandleMixedValueContentColor();
     EditorGUI.EndProperty();
 }
 public PropertyAndTargetHandler(SerializedProperty property, Object target, TargetChoiceHandler.TargetChoiceMenuFunction function)
 {
     this.property = property;
     this.target = target;
     this.function = function;
 }