Пример #1
0
        //* GUI *//

        public static void _OnPreferencesGUI(string searchContext)
        {
            EditorGUILayout.LabelField("Assets/" + AutoSaveFolder + " - Auto-Save Location");
            var R = EditorGUILayout.GetControlRect(GUILayout.Height(30));

            GUI.Box(R, "");
            R.x += 7;
            R.y += 7;
            m_enable.Set(EditorGUI.ToggleLeft(R, "Enable", m_enable));
            GUI.enabled = m_enable;



            m_filesCount.Set(Mathf.Clamp(EditorGUILayout.IntField("Maximum Files Version", m_filesCount), 1, 99));
            m_saveInterval = Mathf.Clamp(EditorGUILayout.IntField("Save Every (Minutes)", (int)(m_saveInterval / 60)), 1, 60) * 60;

            var location = EditorGUILayout.TextField("Location", AutoSaveFolder).Replace('\\', '/');

            if (location.IndexOfAny(System.IO.Path.GetInvalidPathChars()) >= 0)
            {
                location = AutoSaveFolder;
            }

            m_debug.Set(EditorGUILayout.Toggle("Log", m_debug));

            if (GUI.changed)
            {
                AutoSaveFolder = location;

                /*SET_INT( "enablesave" , m_enable ? 1 : 0 );
                 * SET_INT( "auto1" , m_filesCount );
                 * SET_INT( "auto2" , (int)(m_saveInterval / 60) );
                 * SET_BOOL( "auto3" , m_debug );*/
                lastSave = (float)EDITOR_TIMER;
                resetSet();
            }
            GUI.enabled = true;
        }