private static void Init()
        {
            TextToTMPWindow window = GetWindow <TextToTMPWindow>();

            window.titleContent = new GUIContent("Text to TMP");
            window.minSize      = new Vector2(300f, 200f);

            window.Show();
        }
Esempio n. 2
0
        public void DrawOnGUI()
        {
            // Show "Toggle All" toggle
            if (m_length > 1)
            {
                EditorGUI.showMixedValue = m_enabledCount > 0 && m_enabledCount < m_length;

                EditorGUI.BeginChangeCheck();
                bool _enabled = TextToTMPWindow.WordWrappingToggleLeft("- Toggle All -", m_enabledCount > 0);
                if (EditorGUI.EndChangeCheck())
                {
                    for (int i = 0; i < m_length; i++)
                    {
                        enabled[i] = _enabled;
                    }

                    m_enabledCount = _enabled ? m_length : 0;
                }

                EditorGUI.showMixedValue = false;
            }

            for (int i = 0; i < m_length; i++)
            {
                bool _enabled = TextToTMPWindow.WordWrappingToggleLeft(paths[i], enabled[i]);
                if (_enabled != enabled[i])
                {
                    enabled[i] = _enabled;

                    if (_enabled)
                    {
                        m_enabledCount++;
                    }
                    else
                    {
                        m_enabledCount--;
                    }
                }
            }
        }