/// <summary>
        /// Draws the foldout symbol.
        /// </summary>
        /// <param name="unityInterface">The unity interface.</param>
        /// <param name="updatedFoldouts">The updated foldouts.</param>
        /// <param name="index">The index.</param>
        /// <param name="fullMethodDescriptionList">The full method description list.</param>
        public void DrawFoldoutSymbol(IUnityInterfaceWrapper unityInterface, bool[] updatedFoldouts, int index, List <FullMethodDescription> fullMethodDescriptionList)
        {
            bool thereAreParameters = false;

            foreach (FullMethodDescription fullMethodDescription in fullMethodDescriptionList)
            {
                if (fullMethodDescription.Parameters.Parameters.Length > 0)
                {
                    thereAreParameters = true;
                }
            }

            if (thereAreParameters)
            {
                Rect rect = unityInterface.EditorGUILayoutGetControlRect();
                updatedFoldouts[index] = unityInterface.EditorGUIFoldout(rect, updatedFoldouts[index], string.Empty);
            }
            else
            {
                Rect rect = unityInterface.EditorGUILayoutGetControlRect();
                unityInterface.EditorGUIFoldout(rect, false, string.Empty, EditorStyles.label);
            }
        }
示例#2
0
        /// <summary>
        /// Draws the options.
        /// </summary>
        /// <param name="businessLogicData">The business logic data.</param>
        /// <param name="isStaticScenario">If set to <c>true</c> [is static scenario].</param>
        /// <param name="script">The script.</param>
        /// <param name="unityInterface">The unity interface.</param>
        /// <param name="bddComponents">The BDD components.</param>
        private void DrawOptions(RunnerEditorBusinessLogicData businessLogicData, bool isStaticScenario, BDDExtensionRunner script, IUnityInterfaceWrapper unityInterface, Component[] bddComponents)
        {
            Rect rect = unityInterface.EditorGUILayoutGetControlRect();

            businessLogicData.OptionsFoldout = unityInterface.EditorGUIFoldout(rect, businessLogicData.OptionsFoldout, "Options");
            if (businessLogicData.OptionsFoldout)
            {
                if (!isStaticScenario)
                {
                    this.ForceRebuildParametersButton(script, bddComponents);
                }

                unityInterface.EditorGUILayoutSeparator();
                this.ChooseBetweenUpdateAndFixedUpdate(script, this.unityIntefaceWrapper);
                float  width = unityInterface.EditorGUIUtilityCurrentViewWidth();
                int    numberOfSeparatorChars = (int)width / 7;
                string text = string.Empty.PadLeft(numberOfSeparatorChars, '_');

                unityInterface.EditorGUILayoutLabelFieldTruncate(text, width);
            }
        }