コード例 #1
0
        /// <summary>
        /// Update the label of the widget.
        /// </summary>
        public override void UpdateValueLabel()
        {
            int index = m_Field.currentIndex;

            // Fallback just in case, we may be handling sub/sectionned enums here
            if (index < 0)
            {
                index = 0;
            }

            valueLabel.text = m_Field.enumNames[index].text;

            DebugUI.HistoryEnumField field = m_Field as DebugUI.HistoryEnumField;
            int historyDepth = field?.historyDepth ?? 0;

            for (int indexHistory = 0; indexHistory < historyDepth; ++indexHistory)
            {
                if (indexHistory < historyValues.Length && historyValues[indexHistory] != null)
                {
                    historyValues[indexHistory].text = field.enumNames[field.GetHistoryValue(indexHistory)].text;
                }
            }

            if (isActiveAndEnabled)
            {
                StartCoroutine(RefreshAfterSanitization());
            }
        }
コード例 #2
0
        protected override void UpdateValueLabel()
        {
            int index = m_Field.currentIndex;

            // Fallback just in case, we may be handling sub/sectionned enums here
            if (index < 0)
            {
                index = 0;
            }

            valueLabel.text = m_Field.enumNames[index].text;

            DebugUI.HistoryEnumField field = m_Field as DebugUI.HistoryEnumField;
            int historyDepth = field?.historyDepth ?? 0;

            for (int indexHistory = 0; indexHistory < historyDepth; ++indexHistory)
            {
                if (indexHistory < historyValues.Length && historyValues[indexHistory] != null)
                {
                    historyValues[indexHistory].text = field.enumNames[field.GetHistoryValue(indexHistory)].text;
                }
            }
        }