/// <summary>
        /// Draws the parameters rows.
        /// </summary>
        /// <param name="unityInterface">The unity interface.</param>
        /// <param name="foldout">If set to <c>true</c> [foldout].</param>
        /// <param name="fullMethodDescription">The full method description.</param>
        /// <param name="serializedObjects">The serialized objects.</param>
        /// <param name="lockParametersRows">If set to <c>true</c> [lock parameters rows].</param>
        public void DrawParametersRows(IUnityInterfaceWrapper unityInterface, bool foldout, FullMethodDescription fullMethodDescription, Dictionary <Type, ISerializedObjectWrapper> serializedObjects, bool lockParametersRows)
        {
            if (fullMethodDescription != null && foldout && !lockParametersRows)
            {
                ISerializedObjectWrapper serializedObject = null;
                serializedObjects.TryGetValue(fullMethodDescription.ComponentObject.GetType(), out serializedObject);

                foreach (MethodParameter parameter in fullMethodDescription.Parameters.Parameters)
                {
                    string            parameterName     = parameter.ParameterInfoObject.Name;
                    ParameterLocation parameterLocation = parameter.ParameterLocation;

                    // "given.Array.data[0]"
                    string     parameterLocationString = parameterLocation.ParameterArrayLocation.ArrayName + ".Array.data[" + parameterLocation.ParameterArrayLocation.ArrayIndex + "]";
                    GUIContent label = unityInterface.GUIContent(parameterName);
                    ISerializedPropertyWrapper property = serializedObject.FindProperty(parameterLocationString);
                    unityInterface.EditorGUILayoutPropertyField(property, label);
                }
            }

            if (fullMethodDescription != null && foldout && lockParametersRows)
            {
                float labelWidth = unityInterface.EditorGUIUtilityCurrentViewWidth();
                unityInterface.EditorGUILayoutLabelField("When there are some errors the parameters are protected to avoid data lost.", labelWidth);
            }
        }
Exemple #2
0
 /// <summary>
 ///   <see cref="EditorGUILayout.PropertyField" />
 /// </summary>
 /// <param name="property">The property.</param>
 /// <param name="label">The label.</param>
 /// <param name="options">The options.</param>
 /// <returns>
 /// True if the property has children and is expanded and includeChildren was set to false; otherwise false.
 /// </returns>
 public bool EditorGUILayoutPropertyFieldCustomizable(ISerializedPropertyWrapper property, GUIContent label, GUILayoutOption[] options)
 {
     return(EditorGUILayout.PropertyField(property.GetProperty(), label, options));
 }
Exemple #3
0
 /// <summary>
 ///   <see cref="EditorGUILayout.PropertyField" />
 /// </summary>
 /// <param name="property">The property.</param>
 /// <param name="label">The label.</param>
 /// <returns>
 /// True if the property has children and is expanded and includeChildren was set to false; otherwise false.
 /// </returns>
 public bool EditorGUILayoutPropertyField(ISerializedPropertyWrapper property, GUIContent label)
 {
     return(EditorGUILayout.PropertyField(property.GetProperty(), label, GUILayout.ExpandWidth(true)));
 }