Exemple #1
0
    static void PlaymodeStateChanged()
        #endif
    {
        // This is called when we press the Play button, but before serialisation takes place.
        if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)
        {
            var go = GameObject.Find("Easy Save 3 Manager");
            var defaultSettings = ES3EditorUtility.GetDefaultSettings();
            if (go == null && !defaultSettings.addMgrToSceneAutomatically)
            {
                return;
            }

            AddManagerToScene();

            if (defaultSettings.autoUpdateReferences)
            {
                _refMgr.GenerateReferences();
                _refMgr.GeneratePrefabReferences();
            }
            _autoSaveMgr.UpdateAutoSaves();

            AssetDatabase.Refresh();
        }
    }
Exemple #2
0
    public static void RefreshReferences()
    {
        if (_defaultSettings == null)
        {
            _defaultSettings = ES3EditorUtility.GetDefaultSettings();
        }

        if (_defaultSettings.addMgrToSceneAutomatically)
        {
            if (_refMgr == null)
            {
                AddManagerToScene();
            }
        }

        if (_defaultSettings.autoUpdateReferences && _refMgr != null)
        {
            _refMgr.GenerateReferences();
            _refMgr.GeneratePrefabReferences();
        }
    }