public IEnumerator Quit()
        {
            quitStarted = true;
            yield return(new WaitForEndOfFrame());

            if (MainSettingsVars.initialized && MainSettingsVars.animationComponents != null)
            {
                if (MainSettingsVars.animationComponents.Length > 0)
                {
                    for (int i = 0; i < MainSettingsVars.animationComponents.Length; i++)
                    {
                        MainSettingsVars.animationComponents[i].stopAndSave();
                        yield return(null);
                    }
                }
            }
            MainSettingsVars.saveData();
            yield return(null);

            #if UNITY_EDITOR
            UnityEditor.EditorApplication.isPlaying = false;
            #else
            Application.Quit();
            #endif
            yield break;
        }
 void OnDisable()
 {
     MainSettingsVars.saveData();
 }