Assets/SpeechToText/Scripts/SpeechToTextWidgets/SpeechToTextServiceWidget.cs
/// <summary>
/// Finds child components for the results scroll rect and assigns them to the appropriate member variables.
/// Also determines additional text UI member variables.
/// </summary>
Finds child components for the results scroll rect and assigns them to the appropriate member variables.
Also determines additional text UI member variables.
Finds child components for the results scroll rect and assigns them to the appropriate member variables . Also determines additional text UI member variables .
void SetResultsScrollRectChildComponents()
        {
            if (m_ResultsScrollRect != null)
            {
                Transform contentTransform = m_ResultsScrollRect.GetComponent<RectTransform>().Find("Viewport/Content");
                m_ScrollViewContentRect = contentTransform.GetComponent<RectTransform>();
                m_ResultsTextUI = m_ScrollViewContentRect.GetComponentInChildren<Text>();
                m_VerticalTextPadding = m_ScrollViewContentRect.rect.height *
                    (m_ResultsTextUI.rectTransform.anchorMin.y + 1 - m_ResultsTextUI.rectTransform.anchorMax.y);
                m_TextLineHeight = LayoutUtility.GetPreferredHeight(m_ResultsTextUI.rectTransform);
            }
        }
void SetResultsScrollRectChildComponents ( ) { if ( m_ResultsScrollRect != null ) { Transform contentTransform = m_ResultsScrollRect . GetComponent < RectTransform > ( ) . Find ( " " ) ; m_ScrollViewContentRect = contentTransform . GetComponent < RectTransform > ( ) ; m_ResultsTextUI = m_ScrollViewContentRect . GetComponentInChildren < Text > ( ) ; m_VerticalTextPadding = m_ScrollViewContentRect . rect . height * ( m_ResultsTextUI . rectTransform . anchorMin . y + 1 - m_ResultsTextUI . rectTransform . anchorMax . y ) ; m_TextLineHeight = LayoutUtility . GetPreferredHeight ( m_ResultsTextUI . rectTransform ) ; } }
Finds child components for the results scroll rect and assigns them to the appropriate member variables.
Finds child components for the results scroll rect and assigns them to the appropriate member variables .
// Determine the vertical text padding and line height upon initialization // so that the scroll view content rectangle can later be resized based on these.