/// <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); } }
/// <summary> /// Draws the checkbox for choosing between update and fixed update. /// </summary> /// <param name="script">The script.</param> /// <param name="unityInterface">The unity interface.</param> private void ChooseBetweenUpdateAndFixedUpdate(BDDExtensionRunner script, IUnityInterfaceWrapper unityInterface) { GUIContent label = unityInterface.GUIContent("Run under Fixed Update"); bool result = GUILayout.Toggle(script.UseFixedUpdate, label, GUILayout.ExpandWidth(false)); if (result != script.UseFixedUpdate) { Undo.RecordObject(script, "Change the use of Fixed Update."); script.UseFixedUpdate = result; } }